mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 04:56:14 +01:00
gio-tool: Fix memory leaks on error paths in mount command
Various GErrors were being leaked. Coverity CID: 1357351 (amongst others)
This commit is contained in:
parent
996bb34986
commit
a9172c6d03
@ -246,6 +246,8 @@ mount_mountable_done_cb (GObject *object,
|
||||
g_printerr (_("Error mounting location: Anonymous access denied\n"));
|
||||
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED))
|
||||
g_printerr (_("Error mounting location: %s\n"), error->message);
|
||||
|
||||
g_error_free (error);
|
||||
}
|
||||
else
|
||||
g_object_unref (target);
|
||||
@ -274,6 +276,8 @@ mount_done_cb (GObject *object,
|
||||
g_printerr (_("Error mounting location: Anonymous access denied\n"));
|
||||
else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_FAILED_HANDLED))
|
||||
g_printerr (_("Error mounting location: %s\n"), error->message);
|
||||
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
outstanding_mounts--;
|
||||
@ -336,6 +340,7 @@ unmount_done_cb (GObject *object,
|
||||
{
|
||||
g_printerr (_("Error unmounting mount: %s\n"), error->message);
|
||||
success = FALSE;
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
outstanding_mounts--;
|
||||
@ -360,6 +365,7 @@ unmount (GFile *file)
|
||||
{
|
||||
g_printerr (_("Error finding enclosing mount: %s\n"), error->message);
|
||||
success = FALSE;
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -387,6 +393,7 @@ eject_done_cb (GObject *object,
|
||||
{
|
||||
g_printerr (_("Error ejecting mount: %s\n"), error->message);
|
||||
success = FALSE;
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
outstanding_mounts--;
|
||||
@ -411,6 +418,7 @@ eject (GFile *file)
|
||||
{
|
||||
g_printerr (_("Error finding enclosing mount: %s\n"), error->message);
|
||||
success = FALSE;
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -867,6 +875,7 @@ mount_with_device_file_cb (GObject *object,
|
||||
g_printerr (_("Error mounting %s: %s\n"),
|
||||
g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE),
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
success = FALSE;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user