Fix memory leak during do_staging()

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit is contained in:
Castulo Martinez
2020-04-02 12:17:37 -07:00
committed by Otavio Pontes
parent 956822ad78
commit 950478729d
+1
View File
@@ -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;