[PATCH vd_agent_linux 2/7] file-xfers: Reuse cleanup code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 src/vdagent/file-xfers.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/vdagent/file-xfers.c b/src/vdagent/file-xfers.c
index 78d5db3..67bad9e 100644
--- a/src/vdagent/file-xfers.c
+++ b/src/vdagent/file-xfers.c
@@ -220,10 +220,7 @@ void vdagent_file_xfers_start(struct vdagent_file_xfers *xfers,
                     VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE,
                     (uint8_t *)&free_space,
                     sizeof(free_space));
-        vdagent_file_xfer_task_free(task);
-        g_free(file_path);
-        g_free(dir);
-        return;
+        goto cleanup;
     }
 
     dir = g_path_get_dirname(file_path);
@@ -276,6 +273,7 @@ void vdagent_file_xfers_start(struct vdagent_file_xfers *xfers,
 error:
     udscs_write(xfers->vdagentd, VDAGENTD_FILE_XFER_STATUS,
                 msg->id, VD_AGENT_FILE_XFER_STATUS_ERROR, NULL, 0);
+cleanup:
     if (task)
         vdagent_file_xfer_task_free(task);
     g_free(file_path);
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]