summaryrefslogtreecommitdiff
path: root/backport-Fix-Header-leak-when-running-rpm2cpio.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-09-10 03:05:12 +0000
committerCoprDistGit <infra@openeuler.org>2023-09-10 03:05:12 +0000
commit2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 (patch)
treea2af4fd609c7decacbf0ea11926ea338596fb179 /backport-Fix-Header-leak-when-running-rpm2cpio.patch
parent0ae9f87336a3d78d8fbc0a1e5c75cba5f9cf8597 (diff)
automatic import of rpm
Diffstat (limited to 'backport-Fix-Header-leak-when-running-rpm2cpio.patch')
-rw-r--r--backport-Fix-Header-leak-when-running-rpm2cpio.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/backport-Fix-Header-leak-when-running-rpm2cpio.patch b/backport-Fix-Header-leak-when-running-rpm2cpio.patch
new file mode 100644
index 0000000..395234f
--- /dev/null
+++ b/backport-Fix-Header-leak-when-running-rpm2cpio.patch
@@ -0,0 +1,29 @@
+From cf27c6f4963dcf27302d0f4fa39d7787dd03f942 Mon Sep 17 00:00:00 2001
+From: xujing <xujing125@huawei.com>
+Date: Fri, 25 Nov 2022 17:18:33 +0800
+Subject: [PATCH] Fix Header leak when running rpm2cpio
+
+Header "h" is alloced in rpmReadPackageFile but not freed when
+running rpm2cpio. Fix it. Remove redundant whitespace between
+the Fclose()'s too while at it for logical cleanup grouping.
+---
+ rpm2cpio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rpm2cpio.c b/rpm2cpio.c
+index fcc3b3079..940d6ce38 100644
+--- a/rpm2cpio.c
++++ b/rpm2cpio.c
+@@ -96,8 +96,8 @@ int main(int argc, char *argv[])
+ */
+ rc = (ufdCopy(gzdi, fdo) >= payload_size) ? EXIT_SUCCESS : EXIT_FAILURE;
+
++ headerFree(h);
+ Fclose(fdo);
+-
+ Fclose(gzdi); /* XXX gzdi == fdi */
+
+ return rc;
+--
+2.33.0
+