summaryrefslogtreecommitdiff
path: root/ui/profile.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-02-18 10:46:24 -0500
committerMichael Mann <mmann78@netscape.net>2017-02-19 01:27:14 +0000
commit897c75012792cbfdfd275f56b9b4c4418c7354ad (patch)
treea71ffd8063ebbd88d27de505f23a4e06cca4ed4e /ui/profile.c
parent7e70311a4ff6e0b4cc08a481fdf0f1cc422b13cd (diff)
downloadwireshark-897c75012792cbfdfd275f56b9b4c4418c7354ad.tar.gz
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 <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/profile.c')
-rw-r--r--ui/profile.c6
1 files changed, 4 insertions, 2 deletions
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 ();