summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2019-01-04 14:21:12 +0000
committerFrediano Ziglio <fziglio@redhat.com>2019-01-16 09:46:28 +0000
commit73147aff7deb8845cb58508a3c25994b81fbc427 (patch)
treef5a306902609d737a4b0a777b50c6f84edd2261d /src
parentaaed86b649ceabce0c385008c8dbda373c25a55b (diff)
file-xfers: Allocate file_path after disk space check
Variable is not used. Keep code to create file together. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/vdagent/file-xfers.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vdagent/file-xfers.c b/src/vdagent/file-xfers.c
index 67bad9e..77029e7 100644
--- a/src/vdagent/file-xfers.c
+++ b/src/vdagent/file-xfers.c
@@ -202,8 +202,6 @@ void vdagent_file_xfers_start(struct vdagent_file_xfers *xfers,
task->debug = xfers->debug;
- file_path = g_build_filename(xfers->save_dir, task->file_name, NULL);
-
free_space = get_free_space_available(xfers->save_dir);
if (task->file_size > free_space) {
gchar *free_space_str, *file_size_str;
@@ -223,6 +221,7 @@ void vdagent_file_xfers_start(struct vdagent_file_xfers *xfers,
goto cleanup;
}
+ file_path = g_build_filename(xfers->save_dir, task->file_name, NULL);
dir = g_path_get_dirname(file_path);
if (g_mkdir_with_parents(dir, S_IRWXU) == -1) {
syslog(LOG_ERR, "file-xfer: Failed to create dir %s", dir);