[gvfs] Always set 'path2_out' value in create_proxy_for_file2
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] Always set 'path2_out' value in create_proxy_for_file2
- Date: Fri, 10 Apr 2015 08:33:13 +0000 (UTC)
commit 4912a67d372e47e86f07e1ad5ca9a2881ad28157
Author: Christophe Fergeau <cfergeau redhat com>
Date: Sun Mar 29 17:36:37 2015 +0200
Always set 'path2_out' value in create_proxy_for_file2
create_proxy_for_file2() will only set the *path2_out return value if a
mount info was found for the 'file2' argument. However, as this return
value must be freed, it's much better to set 'path2_out' to NULL rather
than leave it unset. This way the caller can call g_free() on the
returned value without having to set 'path2_out' to NULL before calling
create_proxy_for_file2.
https://bugzilla.gnome.org/show_bug.cgi?id=747361
client/gdaemonfile.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 53e5f9a..8e50c49 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -487,8 +487,13 @@ create_proxy_for_file2 (GFile *file1,
*mount_info2_out = g_mount_info_ref (mount_info2);
if (path1_out)
*path1_out = g_strdup (g_mount_info_resolve_path (mount_info1, daemon_file1->path));
- if (path2_out && mount_info2)
- *path2_out = g_strdup (g_mount_info_resolve_path (mount_info2, daemon_file2->path));
+ if (path2_out)
+ {
+ if (mount_info2)
+ *path2_out = g_strdup (g_mount_info_resolve_path (mount_info2, daemon_file2->path));
+ else
+ *path2_out = NULL;
+ }
if (connection_out)
*connection_out = connection;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]