42 lines
1.0 KiB
Diff
42 lines
1.0 KiB
Diff
From 937e725626eecad2e0c34463e733ae123ba2ff5e Mon Sep 17 00:00:00 2001
|
|
From: xujing <xujing125@huawei.com>
|
|
Date: Thu, 12 Sep 2024 20:52:30 +0800
|
|
Subject: [PATCH] Fix memleak when process policies
|
|
|
|
Conflict:adapt the release conditions of optCon
|
|
Reference:https://github.com/rpm-software-management/rpm/commit/937e725626eecad2e0c34463e733ae123ba2ff5e
|
|
|
|
---
|
|
build/policies.c | 8 ++++++++
|
|
1 file changed, 8 insertions(+)
|
|
|
|
diff --git a/build/policies.c b/build/policies.c
|
|
index 16d5f87..6c1050e 100644
|
|
--- a/build/policies.c
|
|
+++ b/build/policies.c
|
|
@@ -282,6 +282,10 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test)
|
|
mod = freeModule(mod);
|
|
name = _free(name);
|
|
types = _free(types);
|
|
+ if (optCon) {
|
|
+ poptFreeContext(optCon);
|
|
+ optCon = NULL;
|
|
+ }
|
|
}
|
|
|
|
rc = RPMRC_OK;
|
|
@@ -290,6 +294,10 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test)
|
|
freeModule(mod);
|
|
free(name);
|
|
free(types);
|
|
+ if (optCon) {
|
|
+ poptFreeContext(optCon);
|
|
+ optCon = NULL;
|
|
+ }
|
|
|
|
return rc;
|
|
}
|
|
--
|
|
2.43.0
|
|
|