mirror of
https://github.com/topjohnwu/selinux.git
synced 2024-12-11 13:26:01 +00:00
libsepol: Fix valgrind errors in constraint_expr_eval_reason
Running valgrind flagged up three "definitely lost" malloc/realloc errors when checking constraints. Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
This commit is contained in:
parent
ab9cbb1f8e
commit
733ea08147
@ -728,6 +728,7 @@ mls_ops:
|
||||
push(answer_list[answer_counter++]);
|
||||
free(a);
|
||||
free(b);
|
||||
free(expr_list[x]);
|
||||
} else if (strncmp(expr_list[x], "not", 3) == 0) {
|
||||
b = pop();
|
||||
b_len = strlen(b);
|
||||
@ -748,6 +749,7 @@ mls_ops:
|
||||
expr_list[x], b);
|
||||
push(answer_list[answer_counter++]);
|
||||
free(b);
|
||||
free(expr_list[x]);
|
||||
} else {
|
||||
push(expr_list[x]);
|
||||
}
|
||||
@ -815,6 +817,8 @@ out:
|
||||
for (x = 0; expr_list[x] != NULL; x++)
|
||||
free(expr_list[x]);
|
||||
}
|
||||
free(answer_list);
|
||||
free(expr_list);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user