libsepol: fix memory leak when destroying avtab containing extended avrules

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
Steve Lawrence 2015-08-28 14:39:09 -04:00
parent e93f755bf7
commit 011da992da

View file

@ -309,6 +309,9 @@ void avtab_destroy(avtab_t * h)
for (i = 0; i < h->nslot; i++) {
cur = h->htable[i];
while (cur != NULL) {
if (cur->key.specified & AVTAB_XPERMS) {
free(cur->datum.xperms);
}
temp = cur;
cur = cur->next;
free(temp);