GNOME Bugzilla – Bug 747361
Fix file_transfer() leak
Last modified: 2015-04-10 08:33:24 UTC
valgrind reported a leak in file_transfer() in gvfs, these 2 patches fix it.
Created attachment 300975 [details] [review] 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.
Created attachment 300976 [details] [review] Fix 'path[12]_out' leak in file_transfer() file_transfer() calls create_proxy_for_file2() passing it 'path1_out' and 'path2_out' arguments. These return values are newly allocated strings, so they must be freed when no longer used. This fixes a leak reported by valgrind.
Review of attachment 300975 [details] [review]: ok
Review of attachment 300976 [details] [review]: ok
Attachment 300975 [details] pushed as 4912a67 - Always set 'path2_out' value in create_proxy_for_file2 Attachment 300976 [details] pushed as d59e687 - Fix 'path[12]_out' leak in file_transfer()