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:NA
Reference:https://github.com/rpm-software-management/rpm/commit/937e725626eecad2e0c34463e733ae123ba2ff5e

---
 build/policies.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/build/policies.c b/build/policies.c
index 5d704c0eb..69062ee6a 100644
--- a/build/policies.c
+++ b/build/policies.c
@@ -289,6 +289,7 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test)
 	mod = freeModule(mod);
 	name = _free(name);
 	types = _free(types);
+	optCon = poptFreeContext(optCon);
     }
 
     rc = RPMRC_OK;
@@ -297,6 +298,7 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test)
     freeModule(mod);
     free(name);
     free(types);
+    poptFreeContext(optCon);
 
     return rc;
 }
-- 
2.33.0

