From 6a6d7ea34f43515dfe3f52aa96b943c272c925a7 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Thu, 22 Dec 2016 15:12:27 -0500 Subject: Convert range API to always use wmem memory. This is mostly to address memory leaks in range preferences (the biggest user of range functionality) on shutdown. Now range preferences must use epan scoped memory when referencing internal preference structures to keep consistency. Change-Id: Idc644f59b5b42fa1d46891542b53ff13ea754157 Reviewed-on: https://code.wireshark.org/review/19387 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu Reviewed-by: Michael Mann --- epan/uat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'epan/uat.c') diff --git a/epan/uat.c b/epan/uat.c index 461dee63d5..b3b0f10e9a 100644 --- a/epan/uat.c +++ b/epan/uat.c @@ -611,7 +611,7 @@ gboolean uat_fld_chk_enum(void* u1 _U_, const char* strptr, guint len, const voi gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, guint len, const void* v _U_, const void* u3, char** err) { char* str = g_strndup(strptr,len); range_t* r = NULL; - convert_ret_t ret = range_convert_str(&r, str,GPOINTER_TO_UINT(u3)); + convert_ret_t ret = range_convert_str(NULL, &r, str,GPOINTER_TO_UINT(u3)); gboolean ret_value = FALSE; switch ( ret ) { @@ -634,6 +634,7 @@ gboolean uat_fld_chk_range(void* u1 _U_, const char* strptr, guint len, const vo } g_free(str); + wmem_free(NULL, r); return ret_value; } -- cgit v1.2.3