gio-tool: Various memory leak fixes

https://bugzilla.gnome.org/show_bug.cgi?id=776169
This commit is contained in:
Ondrej Holy
2016-12-16 14:35:55 +01:00
parent 0beeeb2ec9
commit bde2bde411
3 changed files with 8 additions and 2 deletions

View File

@@ -112,8 +112,6 @@ handle_set (int argc, char *argv[], gboolean do_help)
return 1;
}
file = g_file_new_for_commandline_arg (argv[1]);
if (argc < 3)
{
show_help (context, _("Attribute not specified"));
@@ -177,6 +175,8 @@ handle_set (int argc, char *argv[], gboolean do_help)
return 1;
}
file = g_file_new_for_commandline_arg (argv[1]);
if (!g_file_set_attribute (file,
attribute,
type,
@@ -188,8 +188,11 @@ handle_set (int argc, char *argv[], gboolean do_help)
{
print_error (error->message);
g_error_free (error);
g_object_unref (file);
return 1;
}
g_object_unref (file);
return 0;
}