From 8b6d00ba72c0328f974396bb17e5659d98b93225 Mon Sep 17 00:00:00 2001 From: Yuli Khodorkovskiy Date: Fri, 4 Apr 2014 15:28:30 -0400 Subject: [PATCH] libsemanage: fix memory leak when setting a custom store_path A strdup was setting store_path without freeing the original value in the semanage conf. Signed-off-by: Yuli Khodorkovskiy --- libsemanage/src/handle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libsemanage/src/handle.c b/libsemanage/src/handle.c index 7fcd2b49..ab39943c 100644 --- a/libsemanage/src/handle.c +++ b/libsemanage/src/handle.c @@ -319,6 +319,7 @@ void semanage_select_store(semanage_handle_t * sh, char *storename, /* This just sets the storename to what the user requests, no verification of existance will be done until connect */ + free(sh->conf->store_path); sh->conf->store_path = strdup(storename); assert(sh->conf->store_path); /* no way to return failure */ sh->conf->store_type = storetype;