aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorVasil Velichkov <vvvelichkov@gmail.com>2019-11-06 00:35:03 +0200
committerRoland Knall <rknall@gmail.com>2019-11-06 07:44:19 +0000
commit1675e0fe72e27c40ebc785600fc52871e87cfd42 (patch)
tree90e8666e7bf5c158e29e24f613f35e162d6063f0 /extcap.c
parent3361109b15ad0acd2fc4e3db93ab8358aae5ea78 (diff)
extcap: Fix memory leak in extcap_get_extcap_paths
The path returned by get_persconffile_path needs to be freed. Direct leak of 64 byte(s) in 1 object(s) allocated from: #0 0x5653e6c98e06 in realloc (/home/vasko/sources/wireshark/build_clang/run/wireshark+0x2486e06) #1 0x7f5b697f2e7d in g_realloc gmem.c:164:16 #2 0x7f5b69810016 in g_string_maybe_expand gstring.c:102:21 #3 0x7f5b69810369 gstring.c:476:7 #4 0x7f5b69810369 in g_string_insert_len gstring.c:424:1 #5 0x7f5b697d808d in g_build_path_va gfileutils.c:1766:7 #6 0x7f5b697d9518 in g_build_filename_va gfileutils.c:1987:9 #7 0x7f5b697d9518 in g_build_filename gfileutils.c:2069:9 #8 0x7f5b69bd0c28 in get_persconffile_path /home/vasko/sources/wireshark/wsutil/filesystem.c:1856:12 #9 0x5653e8825f82 in extcap_get_extcap_paths /home/vasko/sources/wireshark/extcap.c:258:53 #10 0x5653e8825f82 in extcap_run_all /home/vasko/sources/wireshark/extcap.c:449 #11 0x5653e8825f82 in extcap_load_interface_list /home/vasko/sources/wireshark/extcap.c:2024 #12 0x5653e7775356 in main /home/vasko/sources/wireshark/ui/qt/main.cpp:726:5 Change-Id: I275d0ad6f06fbf3222c2d4ebef7f3079073404a0 Reviewed-on: https://code.wireshark.org/review/34994 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'extcap.c')
-rw-r--r--extcap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/extcap.c b/extcap.c
index 8921915c7a..d371b5ef52 100644
--- a/extcap.c
+++ b/extcap.c
@@ -255,7 +255,10 @@ extcap_get_extcap_paths(void)
{
GSList *paths = NULL;
- paths = extcap_get_extcap_paths_from_dir(paths, get_persconffile_path("extcap", FALSE));
+ char *persconffile_path = get_persconffile_path("extcap", FALSE);
+ paths = extcap_get_extcap_paths_from_dir(paths, persconffile_path);
+ g_free(persconffile_path);
+
paths = extcap_get_extcap_paths_from_dir(paths, get_extcap_dir());
return paths;