gvfs r1907 - in trunk: . common daemon
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r1907 - in trunk: . common daemon
- Date: Mon, 25 Aug 2008 13:27:36 +0000 (UTC)
Author: matthiasc
Date: Mon Aug 25 13:27:36 2008
New Revision: 1907
URL: http://svn.gnome.org/viewvc/gvfs?rev=1907&view=rev
Log:
Plug some leaks on error paths
Modified:
trunk/ChangeLog
trunk/common/gdbusutils.c
trunk/common/gmountoperationdbus.c
trunk/daemon/gvfsbackendgphoto2.c
trunk/daemon/gvfsbackendtrash.c
trunk/daemon/gvfsjobsetattribute.c
Modified: trunk/common/gdbusutils.c
==============================================================================
--- trunk/common/gdbusutils.c (original)
+++ trunk/common/gdbusutils.c Mon Aug 25 13:27:36 2008
@@ -1348,6 +1348,7 @@
g_set_error_literal (&data->io_error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Can't open dbus connection");
g_idle_add (async_call_error_at_idle, data);
+ dbus_error_free (&derror);
return;
}
}
Modified: trunk/common/gmountoperationdbus.c
==============================================================================
--- trunk/common/gmountoperationdbus.c (original)
+++ trunk/common/gmountoperationdbus.c Mon Aug 25 13:27:36 2008
@@ -225,6 +225,7 @@
if (!dbus_connection_send (op_dbus->connection, reply, NULL))
_g_dbus_oom ();
dbus_message_unref (reply);
+ dbus_error_free (&error);
return;
}
@@ -297,6 +298,7 @@
if (!dbus_connection_send (op_dbus->connection, reply, NULL))
_g_dbus_oom ();
dbus_message_unref (reply);
+ dbus_error_free (&error);
return;
}
Modified: trunk/daemon/gvfsbackendgphoto2.c
==============================================================================
--- trunk/daemon/gvfsbackendgphoto2.c (original)
+++ trunk/daemon/gvfsbackendgphoto2.c Mon Aug 25 13:27:36 2008
@@ -1324,6 +1324,7 @@
{
error = get_error_from_gphoto2 (_("Failed to get folder list"), rc);
g_vfs_job_failed_from_error (job, error);
+ g_error_free (error);
return FALSE;
}
@@ -1657,6 +1658,7 @@
num_open_files),
num_open_files);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
return;
}
@@ -1718,6 +1720,7 @@
{
error = get_error_from_gphoto2 (_("Error creating file object"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
free_read_handle (read_handle);
goto out;
}
@@ -1732,6 +1735,7 @@
{
error = get_error_from_gphoto2 (_("Error getting file"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
free_read_handle (read_handle);
goto out;
}
@@ -1741,6 +1745,7 @@
{
error = get_error_from_gphoto2 (_("Error getting data from file"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
free_read_handle (read_handle);
goto out;
}
@@ -1885,9 +1890,11 @@
split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
+ error = NULL;
if (!file_get_info (gphoto2_backend, dir, name, info, &error, FALSE))
{
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
}
else
{
@@ -1909,7 +1916,6 @@
GFileAttributeMatcher *matcher)
{
GVfsBackendGphoto2 *gphoto2_backend = G_VFS_BACKEND_GPHOTO2 (backend);
- GError *error;
char *dir;
char *name;
gboolean ret;
@@ -1920,7 +1926,7 @@
split_filename_with_ignore_prefix (gphoto2_backend, filename, &dir, &name);
- if (!file_get_info (gphoto2_backend, dir, name, info, &error, TRUE))
+ if (!file_get_info (gphoto2_backend, dir, name, info, NULL, TRUE))
{
DEBUG (" BUU no info from cache for try_query_info (%s)", filename);
goto out;
@@ -2007,6 +2013,7 @@
{
error = get_error_from_gphoto2 (_("Failed to get folder list"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
g_free (filename);
return;
}
@@ -2025,9 +2032,11 @@
gp_list_get_name (list, n, &name);
DEBUG (" enum folder '%s'", name);
info = g_file_info_new ();
+ error = NULL;
if (!file_get_info (gphoto2_backend, filename, name, info, &error, FALSE))
{
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
g_list_foreach (l, (GFunc) g_object_unref, NULL);
g_list_free (l);
gp_list_free (list);
@@ -2070,6 +2079,7 @@
{
error = get_error_from_gphoto2 (_("Failed to get file list"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
g_free (filename);
return;
}
@@ -2089,9 +2099,11 @@
DEBUG (" enum file '%s'", name);
info = g_file_info_new ();
+ error = NULL;
if (!file_get_info (gphoto2_backend, filename, name, info, &error, FALSE))
{
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
g_list_foreach (l, (GFunc) g_object_unref, NULL);
g_list_free (l);
gp_list_free (list);
@@ -2359,6 +2371,7 @@
{
error = get_error_from_gphoto2 (_("Error creating directory"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
@@ -2588,6 +2601,7 @@
{
error = get_error_from_gphoto2 (_("Error renaming dir"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
caches_invalidate_file (gphoto2_backend, dir, name);
@@ -2600,6 +2614,7 @@
{
error = get_error_from_gphoto2 (_("Error renaming file"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
caches_invalidate_file (gphoto2_backend, dir, name);
@@ -2674,6 +2689,7 @@
{
error = get_error_from_gphoto2 (_("Error deleting directory"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
caches_invalidate_file (gphoto2_backend, dir, name);
@@ -2699,6 +2715,7 @@
{
error = get_error_from_gphoto2 (_("Error deleting file"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
@@ -2798,6 +2815,7 @@
{
error = get_error_from_gphoto2 (_("Cannot allocate new file to append to"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
write_handle_free (handle);
goto out;
}
@@ -2812,6 +2830,7 @@
{
error = get_error_from_gphoto2 (_("Cannot read file to append to"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
write_handle_free (handle);
gp_file_unref (file);
goto out;
@@ -2822,6 +2841,7 @@
{
error = get_error_from_gphoto2 (_("Cannot get data of file to append to"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
write_handle_free (handle);
gp_file_unref (file);
goto out;
@@ -3108,6 +3128,7 @@
{
error = get_error_from_gphoto2 (_("Error writing file"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
@@ -3210,6 +3231,7 @@
DEBUG (" error renaming dir");
error = get_error_from_gphoto2 (_("Error renaming dir"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
}
@@ -3222,6 +3244,7 @@
DEBUG (" error renaming file");
error = get_error_from_gphoto2 (_("Error renaming file"), rc);
g_vfs_job_failed_from_error (G_VFS_JOB (job), error);
+ g_error_free (error);
goto out;
}
}
Modified: trunk/daemon/gvfsbackendtrash.c
==============================================================================
--- trunk/daemon/gvfsbackendtrash.c (original)
+++ trunk/daemon/gvfsbackendtrash.c Mon Aug 25 13:27:36 2008
@@ -561,7 +561,7 @@
{
dirs = g_list_prepend (dirs, home_trash);
if (statbuf.st_nlink != 2)
- has_trash_files = TRUE;;
+ has_trash_files = TRUE;
}
else
g_free (home_trash);
Modified: trunk/daemon/gvfsjobsetattribute.c
==============================================================================
--- trunk/daemon/gvfsjobsetattribute.c (original)
+++ trunk/daemon/gvfsjobsetattribute.c Mon Aug 25 13:27:36 2008
@@ -86,7 +86,6 @@
GVfsJobSetAttribute *job;
DBusMessage *reply;
DBusMessageIter iter, array_iter;
- DBusError derror;
const gchar *filename = NULL;
gint filename_len;
GFileQueryInfoFlags flags;
@@ -95,8 +94,6 @@
GFileAttributeType type;
GDbusAttributeValue value;
- dbus_error_init (&derror);
-
dbus_message_iter_init (message, &iter);
if (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_ARRAY &&
@@ -121,7 +118,6 @@
reply = dbus_message_new_error (message,
DBUS_ERROR_FAILED,
_("Invalid dbus message"));
- dbus_error_free (&derror);
dbus_connection_send (connection, reply, NULL);
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]