From 2bc2b430bc4c1a9a0bfd1c01da68bd53bf7da052 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sun, 10 Sep 2023 03:05:12 +0000 Subject: automatic import of rpm --- ...sbp-leak-when-running-rpmbuild-with-quiet.patch | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch (limited to 'backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch') diff --git a/backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch b/backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch new file mode 100644 index 0000000..0c98b86 --- /dev/null +++ b/backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch @@ -0,0 +1,28 @@ +From 6130bd31038ff17a03fcac6ec7e41ac744163dde Mon Sep 17 00:00:00 2001 +From: xujing +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, + spec->buildSubdir)) { +-- +2.27.0 + -- cgit v1.2.3