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 <ykhodorkovskiy@tresys.com>
This commit is contained in:
parent
fa095ad7a1
commit
8b6d00ba72
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue