diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2015-03-29 17:36:37 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2015-04-10 10:08:35 +0200 |
commit | 4912a67d372e47e86f07e1ad5ca9a2881ad28157 (patch) | |
tree | 69b1fa7d08f57d1b17ab1e504eb0c42e2e1305a0 | |
parent | f5ee590e2e14d9419fb7c30d05d9be7d0aee3532 (diff) | |
download | gvfs-4912a67d372e47e86f07e1ad5ca9a2881ad28157.tar.gz |
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
-rw-r--r-- | client/gdaemonfile.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index 53e5f9a0..8e50c499 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; |