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:
Eric Paris 2013-01-23 15:07:26 -05:00
parent efb6347dd3
commit 0834ff3022

View file

@ -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);