aboutsummaryrefslogtreecommitdiffstats
path: root/epan/uat.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-02-26 19:03:01 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-02-26 19:03:01 +0000
commit1c319c4e2c0f299c9ff9e54726b28221c84cb228 (patch)
tree3b519f8afbe57bd69120f2421bf40a44a26f0354 /epan/uat.c
parent9fdc3e961d7b6c0731ad218095961763428a1baf (diff)
get_datafile_path() and get_persconffile_path() return malloc'd memory,
free it when we're done with the file name. svn path=/trunk/; revision=24477
Diffstat (limited to 'epan/uat.c')
-rw-r--r--epan/uat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/uat.c b/epan/uat.c
index e94bb2d9bd..cf891685ae 100644
--- a/epan/uat.c
+++ b/epan/uat.c
@@ -154,18 +154,24 @@ void uat_remove_record_idx(uat_t* uat, guint idx) {
}
+/* The returned filename was g_malloc()'d so the caller must free it */
gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing) {
+
gchar* pers_fname = get_persconffile_path(uat->filename, TRUE, for_writing);
if (! for_writing ) {
gchar* data_fname = get_datafile_path(uat->filename);
if ((! file_exists(pers_fname) ) && file_exists(data_fname)) {
+ g_free(pers_fname);
return data_fname;
}
+
+ g_free(data_fname);
}
if ((! file_exists(pers_fname) ) && (! for_writing ) ) {
+ g_free(pers_fname);
return NULL;
}