libselinux: do not leak file contexts with mmap'd backend
We use strdup to store the intended context when we have an mmap'd file backend. We, however, skipped freeing those contexts. Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
efb6347dd3
commit
0834ff3022
1 changed files with 2 additions and 2 deletions
|
@ -553,12 +553,12 @@ static void closef(struct selabel_handle *rec)
|
|||
|
||||
for (i = 0; i < data->nspec; i++) {
|
||||
spec = &data->spec_arr[i];
|
||||
free(spec->lr.ctx_trans);
|
||||
free(spec->lr.ctx_raw);
|
||||
if (spec->from_mmap)
|
||||
continue;
|
||||
free(spec->regex_str);
|
||||
free(spec->type_str);
|
||||
free(spec->lr.ctx_raw);
|
||||
free(spec->lr.ctx_trans);
|
||||
if (spec->regcomp) {
|
||||
pcre_free(spec->regex);
|
||||
pcre_free_study(spec->sd);
|
||||
|
|
Loading…
Reference in a new issue