From 950478729dba11a76807e4e92d28678765889dc4 Mon Sep 17 00:00:00 2001 From: Castulo Martinez Date: Thu, 2 Apr 2020 11:35:00 -0700 Subject: [PATCH] Fix memory leak during do_staging() Signed-off-by: Castulo Martinez --- src/staging.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/staging.c b/src/staging.c index 370b547c..8e949dc1 100644 --- a/src/staging.c +++ b/src/staging.c @@ -140,6 +140,7 @@ enum swupd_code do_staging(struct file *file, struct manifest *MoM) (file->is_file && !S_ISREG(s.st_mode))) { // file type changed, move old out of the way for new ret = sys_rm_recursive(statfile); + free_and_clear_pointer(&statfile); if (ret != 0 && ret != -ENOENT) { ret = SWUPD_COULDNT_REMOVE_FILE; goto out;