diff options
author | Ondrej Holy <oholy@redhat.com> | 2016-06-09 18:41:58 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2016-06-10 14:12:01 +0200 |
commit | 9f1584ad558f3dfae7d6490f84c21155fc55e526 (patch) | |
tree | 485a4da50f88541e6d69f695d8970ebe9fed8e7a | |
parent | 4c2953b0d806062bcce8985a3077e088a48753a5 (diff) | |
download | gvfs-9f1584ad558f3dfae7d6490f84c21155fc55e526.tar.gz |
afc: Fix several memory leaks
Memory is not released on several places, when handling errors
mostly. Add missing g_free calls to avoid those memory leaks.
-rw-r--r-- | daemon/gvfsbackendafc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c index 068eb565..2f264ab5 100644 --- a/daemon/gvfsbackendafc.c +++ b/daemon/gvfsbackendafc.c @@ -1120,10 +1120,13 @@ not_found_bail: new_path ? new_path : path, AFC_FOPEN_RDONLY, &fd), G_VFS_JOB(job)))) { + g_free (new_path); g_free (app); return; } + g_free (new_path); + handle = g_vfs_backend_file_handle_new (self, app); handle->fd = fd; handle->afc_cli = afc_cli; @@ -1168,6 +1171,7 @@ g_vfs_backend_afc_create (GVfsBackend *backend, info = g_hash_table_lookup (self->apps, app); if (info == NULL) { + g_free (new_path); g_free (app); g_vfs_backend_afc_check (AFC_E_OBJECT_NOT_FOUND, G_VFS_JOB(job)); return; @@ -1237,6 +1241,7 @@ g_vfs_backend_afc_append_to (GVfsBackend *backend, info = g_hash_table_lookup (self->apps, app); if (info == NULL) { + g_free (new_path); g_free (app); g_vfs_backend_afc_check (AFC_E_OBJECT_NOT_FOUND, G_VFS_JOB(job)); return; @@ -1335,6 +1340,7 @@ g_vfs_backend_afc_replace (GVfsBackend *backend, info = g_hash_table_lookup (self->apps, app); if (info == NULL) { + g_free (new_path); g_free (app); g_vfs_backend_afc_check (AFC_E_OBJECT_NOT_FOUND, G_VFS_JOB(job)); return; @@ -2617,6 +2623,9 @@ g_vfs_backend_afc_move (GVfsBackend *backend, info = g_hash_table_lookup (self->apps, app_src); if (info == NULL) { + g_free (app_src); + g_free (new_src); + g_free (new_dst); g_vfs_backend_afc_check (AFC_E_OBJECT_NOT_FOUND, G_VFS_JOB(job)); return; } |