1 Star 0 Fork 73

gys/rpm

forked from src-openEuler/rpm 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
xujing 提交于 2023-02-02 10:49 . update version to 4.18.0
From 6130bd31038ff17a03fcac6ec7e41ac744163dde Mon Sep 17 00:00:00 2001
From: xujing <xujing125@huawei.com>
Date: Sat, 26 Nov 2022 11:39:48 +0800
Subject: [PATCH 4/5] Fix *sbp leak when running rpmbuild with --quiet
When running rpmbuild with --quiet, the "*sbp" may be alloced many
times in buildSpec by calling doScript but only freed once. Fix it.
---
build/build.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/build/build.c b/build/build.c
index 9cd569b83..4437f6c9c 100644
--- a/build/build.c
+++ b/build/build.c
@@ -216,6 +216,9 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name,
buildCmd = rpmExpand(mCmd, " ", scriptName, NULL);
(void) poptParseArgvString(buildCmd, &argc, &argv);
+ if (sb_stdoutp && *sb_stdoutp)
+ *sb_stdoutp = freeStringBuf(*sb_stdoutp);
+
rpmlog(RPMLOG_NOTICE, _("Executing(%s): %s\n"), name, buildCmd);
if (rpmfcExec((ARGV_const_t)argv, NULL, sb_stdoutp, 1, buildSubdir)) {
rpmlog(RPMLOG_ERR, _("Bad exit status from %s (%s)\n"),
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gys66/rpm.git
git@gitee.com:gys66/rpm.git
gys66
rpm
rpm
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385