diff options
-rw-r--r-- | epan/uat.c | 6 | ||||
-rw-r--r-- | epan/uat_load.l | 2 |
2 files changed, 8 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; } diff --git a/epan/uat_load.l b/epan/uat_load.l index 42593998d9..ec93d11100 100644 --- a/epan/uat_load.l +++ b/epan/uat_load.l @@ -289,6 +289,7 @@ gboolean uat_load(uat_t* uat_in, char** err) { if (!(yyin = eth_fopen(fname,"r"))) { *err = strerror(errno); + g_free(fname); return FALSE; } @@ -299,6 +300,7 @@ gboolean uat_load(uat_t* uat_in, char** err) { BEGIN START_OF_LINE; DUMP(fname); + g_free(fname); /* we're done with the file name now */ yylex(); yyrestart(NULL); |