diff options
author | Kirill Batuzov | 2014-04-10 16:07:57 +0200 |
---|---|---|
committer | Michael Tokarev | 2014-04-28 06:55:32 +0200 |
commit | 00a9cacaea9afa4cb72871d1067bb21f75dcc3bd (patch) | |
tree | a65af6c12013220d05f8442190658608f12f4f9e /util | |
parent | virtfs-proxy-helper: fix call to accept (diff) | |
download | qemu-00a9cacaea9afa4cb72871d1067bb21f75dcc3bd.tar.gz qemu-00a9cacaea9afa4cb72871d1067bb21f75dcc3bd.tar.xz qemu-00a9cacaea9afa4cb72871d1067bb21f75dcc3bd.zip |
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>
Diffstat (limited to 'util')
-rw-r--r-- | util/path.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/path.c b/util/path.c index 623219e4c5..5c59d9f1d3 100644 --- a/util/path.c +++ b/util/path.c @@ -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); |