summaryrefslogtreecommitdiff
path: root/backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-09-18 07:05:42 +0000
committerCoprDistGit <infra@openeuler.org>2024-09-18 07:05:42 +0000
commit4ad1d692311b38472d44f5deb9c32634b334ed4d (patch)
tree3e004676c8e07b495fdeda7291033d0fde73d783 /backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch
parente248808867f90830a43b5ca5d192bef9dd2edec2 (diff)
automatic import of rpm
Diffstat (limited to 'backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch')
-rw-r--r--backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch b/backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch
new file mode 100644
index 0000000..27976f9
--- /dev/null
+++ b/backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch
@@ -0,0 +1,28 @@
+From 1849c99826fdc64e8bd0847675e28e2619c64de6 Mon Sep 17 00:00:00 2001
+From: Florian Festi <ffesti@redhat.com>
+Date: Mon, 13 May 2024 15:42:07 +0200
+Subject: [PATCH] Free old cookie value to prevent a memory leak
+
+This keeps the old behaviour of overriding the cookie. This may not me
+correct as the code looks like it reads the cookie from the srpm when
+doing rpmbuild --rebuild for the purpose of preserving it. Otoh the
+current behaviour with overriding it even in this case has been around
+for years. This whole cookie business seems to have some other issues,
+too, and needs further investigation. Here we are only trying to fix the
+memory leak.
+---
+ build/pack.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build/pack.c b/build/pack.c
+index 4318a6132f..e87d66deb6 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -472,6 +472,7 @@ static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp,
+
+ /* Create and add the cookie */
+ if (cookie) {
++ free(*cookie);
+ rasprintf(cookie, "%s %d", buildHost, buildTime);
+ headerPutString(pkg->header, RPMTAG_COOKIE, *cookie);
+ }