mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
gio-tool: Various memory leak fixes
https://bugzilla.gnome.org/show_bug.cgi?id=776169
This commit is contained in:
parent
0beeeb2ec9
commit
bde2bde411
@ -254,6 +254,7 @@ get_writable_info (GFile *file)
|
||||
list->infos[i].name,
|
||||
attribute_type_to_string (list->infos[i].type),
|
||||
(*flags != 0)?", ":"", flags);
|
||||
g_free (flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,12 +176,14 @@ add_watch (const gchar *cmdline,
|
||||
g_signal_connect (monitor, "changed", G_CALLBACK (watch_callback), g_strdup (cmdline));
|
||||
|
||||
monitor = NULL; /* leak */
|
||||
g_object_unref (file);
|
||||
|
||||
return TRUE;
|
||||
|
||||
err:
|
||||
print_file_error (file, error->message);
|
||||
g_error_free (error);
|
||||
g_object_unref (file);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user