mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-11-05 20:35:44 +00:00
init_paths: fix minor memory leak
Fields "name" (created with strdup in new_entry) and "pathname" (created with g_strdup_printf in new_entry) of pathelem struct should be freed before the whole struct is. Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
b0f9300ca3
commit
00a9cacaea
1 changed files with 3 additions and 1 deletions
|
@ -160,7 +160,9 @@ void init_paths(const char *prefix)
|
|||
base = new_entry("", NULL, pref_buf);
|
||||
base = add_dir_maybe(base);
|
||||
if (base->num_entries == 0) {
|
||||
free (base);
|
||||
g_free(base->pathname);
|
||||
free(base->name);
|
||||
free(base);
|
||||
base = NULL;
|
||||
} else {
|
||||
set_parents(base, base);
|
||||
|
|
Loading…
Reference in a new issue