summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxujing <xujing125@huawei.com>2022-11-28 11:10:19 +0800
committerMichal Domonkos <mdomonko@redhat.com>2023-03-13 15:32:25 +0100
commitd1d6eb987f9e8294ecd5c166f71eea16a048403e (patch)
tree763b6be216b51e926b5349d52c803f69c11edc78
parent0557b0f9a564c2af227f6cb7c357e46db5b73821 (diff)
downloadrpm-d1d6eb987f9e8294ecd5c166f71eea16a048403e.tar.gz
Fix memleak when fsmRename failed in fsmCommit
The "dest" is alloced in fsmFsPath but not freed when fsmRename failed in fsmCommit. Fix it. (cherry picked from commit 688c4ad34d197055eb8f58fb4e45065af881598c)
-rw-r--r--lib/fsm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index f47060fad..5e7c92722 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -782,7 +782,8 @@ static int fsmCommit(int dirfd, char **path, rpmfi fi, rpmFileAction action, con
}
free(*path);
*path = dest;
- }
+ } else
+ free(dest);
}
}