diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-09-10 03:05:12 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-09-10 03:05:12 +0000 |
| commit | 2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 (patch) | |
| tree | a2af4fd609c7decacbf0ea11926ea338596fb179 /backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch | |
| parent | 0ae9f87336a3d78d8fbc0a1e5c75cba5f9cf8597 (diff) | |
automatic import of rpm
Diffstat (limited to 'backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch')
| -rw-r--r-- | backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch b/backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch new file mode 100644 index 0000000..889cf6e --- /dev/null +++ b/backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch @@ -0,0 +1,28 @@ +From 688c4ad34d197055eb8f58fb4e45065af881598c Mon Sep 17 00:00:00 2001 +From: xujing <xujing125@huawei.com> +Date: Mon, 28 Nov 2022 11:10:19 +0800 +Subject: [PATCH 1/3] Fix memleak when fsmRename failed in fsmCommit + +The "dest" is alloced in fsmFsPath but not freed when fsmRename failed +in fsmCommit. Fix it. +--- + lib/fsm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/fsm.c b/lib/fsm.c +index 7987abbc9..e38155df7 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); + } + } + +-- +2.27.0 + |
