From 897c75012792cbfdfd275f56b9b4c4418c7354ad Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 18 Feb 2017 10:46:24 -0500 Subject: Clean up some memory leaks in wsutil/filesystem.c The fixes involve functions always returning a string that needs to be freed by the caller. That way the static string pointers within the functions don't end up leaking at program end. Change-Id: I35a8dc37536c2927d88f33217887f62efafcc8ca Reviewed-on: https://code.wireshark.org/review/20175 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- ui/profile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui/profile.c') diff --git a/ui/profile.c b/ui/profile.c index 2319f4e647..24f3d759ac 100644 --- a/ui/profile.c +++ b/ui/profile.c @@ -312,8 +312,8 @@ init_profile_list(void) { WS_DIR *dir; /* scanned directory */ WS_DIRENT *file; /* current file */ - const gchar *profiles_dir, *name; - gchar *filename; + const gchar *name; + gchar *profiles_dir, *filename; empty_profile_list(TRUE); @@ -334,6 +334,7 @@ init_profile_list(void) } ws_dir_close (dir); } + g_free(profiles_dir); /* Global profiles */ profiles_dir = get_global_profiles_dir(); @@ -350,6 +351,7 @@ init_profile_list(void) } ws_dir_close (dir); } + g_free(profiles_dir); /* Make the current list and the edited list equal */ copy_profile_list (); -- cgit v1.2.1