Skip to content

Commit

Permalink
Fix memleak when process policies
Browse files Browse the repository at this point in the history
  • Loading branch information
JetXujing committed Sep 19, 2024
1 parent ea4a98b commit 9d9f9a5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build/policies.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,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;
Expand All @@ -298,6 +302,9 @@ static rpmRC processPolicies(rpmSpec spec, Package pkg, int test)
free(name);
free(types);

if (optCon)
poptFreeContext(optCon);

return rc;
}
#endif
Expand Down

0 comments on commit 9d9f9a5

Please sign in to comment.