加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Free-old-cookie-value-to-prevent-a-memory-leak.patch 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
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);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化