[gvfs] dav: Fix up error handling when moving
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] dav: Fix up error handling when moving
- Date: Sun, 25 Jan 2015 20:15:54 +0000 (UTC)
commit 74a223930ee027babc6f6573dc4f49436bcb7c90
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Thu Jan 22 22:40:59 2015 +0000
dav: Fix up error handling when moving
Don't leak the source and target URI when doing a server-side move.
Also, don't continue after giving an G_IO_ERROR_EXISTS.
https://bugzilla.gnome.org/show_bug.cgi?id=743379
daemon/gvfsbackenddav.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index d4f50a6..e6c520e 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -2753,8 +2753,7 @@ do_move (GVfsBackend *backend,
if (!res && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
- g_error_free (error);
- return;
+ goto error;
}
if (res)
@@ -2776,7 +2775,7 @@ do_move (GVfsBackend *backend,
G_IO_ERROR,
G_IO_ERROR_IS_DIRECTORY,
_("Can't move over directory"));
- return;
+ goto error;
}
else if (source_ft == G_FILE_TYPE_DIRECTORY)
{
@@ -2792,7 +2791,7 @@ do_move (GVfsBackend *backend,
{
http_job_failed (G_VFS_JOB (job), msg);
g_object_unref (msg);
- return;
+ goto error;
}
g_object_unref (msg);
}
@@ -2800,8 +2799,7 @@ do_move (GVfsBackend *backend,
else
{
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
- g_error_free (error);
- return;
+ goto error;
}
}
else
@@ -2810,6 +2808,7 @@ do_move (GVfsBackend *backend,
G_IO_ERROR,
G_IO_ERROR_EXISTS,
_("Target file exists"));
+ goto error;
}
}
@@ -2847,6 +2846,9 @@ do_move (GVfsBackend *backend,
http_job_failed (G_VFS_JOB (job), msg);
g_object_unref (msg);
+
+error:
+ g_clear_error (&error);
soup_uri_free (source_uri);
soup_uri_free (target_uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]