From 77059c39e8a06743de9a15fb4501dac85ae0f889 Mon Sep 17 00:00:00 2001 From: Jan Zarsky Date: Wed, 13 Sep 2017 10:16:42 +0200 Subject: [PATCH] libsepol: fix memory leak in sepol_bool_query() When sepol_bool_query() returns NULL response, variable name is not freed. Fix this by calling free() before returning. Signed-off-by: Jan Zarsky --- libsepol/src/booleans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libsepol/src/booleans.c b/libsepol/src/booleans.c index c914a286..30fcf29d 100644 --- a/libsepol/src/booleans.c +++ b/libsepol/src/booleans.c @@ -155,6 +155,7 @@ int sepol_bool_query(sepol_handle_t * handle, booldatum = hashtab_search(policydb->p_bools.table, name); if (!booldatum) { *response = NULL; + free(name); return STATUS_SUCCESS; }