diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-05-16 08:13:23 +0100 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-05-20 07:45:44 +0100 |
commit | 7056e01cceea3e6a8970c1fc4637ad959e7cd3de (patch) | |
tree | ec7b93746f9b9a95c83c9928206d291e22133d84 /client | |
parent | e7e6e1cde38f935e04e3e9d651eacf57557ff0c5 (diff) | |
download | gvfs-7056e01cceea3e6a8970c1fc4637ad959e7cd3de.tar.gz |
client: Always set path[12]_out in create_proxy_for_file2
d59e6873086f ("Fix 'path[12]_out' leak in file_transfer()") assumed that
path[12]_out were always set by create_proxy_for_file2 but this is not
always the case. Fix it so that create_proxy_for_file2 always sets
path[12]_out.
To reproduce the bug:
$ gvfs-copy --progress smb://host/unmounted/a smb://host/unmounted/b
Segmentation fault (core dumped)
https://bugzilla.gnome.org/show_bug.cgi?id=749462
Diffstat (limited to 'client')
-rw-r--r-- | client/gdaemonfile.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index db36913a..b744d532 100644 --- a/client/gdaemonfile.c +++ b/client/gdaemonfile.c @@ -435,6 +435,11 @@ create_proxy_for_file2 (GFile *file1, GMountInfo *mount_info1, *mount_info2; GDBusConnection *connection; + if (path1_out) + *path1_out = NULL; + if (path2_out) + *path2_out = NULL; + proxy = NULL; mount_info2 = NULL; @@ -487,13 +492,8 @@ 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) - { - if (mount_info2) - *path2_out = g_strdup (g_mount_info_resolve_path (mount_info2, daemon_file2->path)); - else - *path2_out = NULL; - } + if (path2_out && mount_info2) + *path2_out = g_strdup (g_mount_info_resolve_path (mount_info2, daemon_file2->path)); if (connection_out) *connection_out = connection; |