summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--epan/proto.c7
-rw-r--r--epan/wslua/wslua_proto_field.c10
2 files changed, 12 insertions, 5 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 66fb23b421..4b10b356e4 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -5733,9 +5733,12 @@ free_deregistered_field (gpointer data, gpointer user_data _U_)
g_free((gchar *)protocol->short_name);
break;
}
- case FT_BOOLEAN:
- /* Nothing to free */
+ case FT_BOOLEAN: {
+ true_false_string *tf = (true_false_string *)hfi->strings;
+ g_free ((gchar *)tf->true_string);
+ g_free ((gchar *)tf->false_string);
break;
+ }
case FT_UINT64:
case FT_INT64: {
val64_string *vs64 = (val64_string *)hfi->strings;
diff --git a/epan/wslua/wslua_proto_field.c b/epan/wslua/wslua_proto_field.c
index d10089fd25..9895b2697b 100644
--- a/epan/wslua/wslua_proto_field.c
+++ b/epan/wslua/wslua_proto_field.c
@@ -226,7 +226,7 @@ static val64_string* val64_string_from_table(lua_State* L, int idx) {
static true_false_string* true_false_string_from_table(lua_State* L, int idx) {
GArray* tfs = g_array_new(TRUE,TRUE,sizeof(true_false_string));
true_false_string* ret;
- true_false_string tf = { "True", "False" };
+ true_false_string tf = { g_strdup("True"), g_strdup("False") };
if (lua_isnil(L,idx)) {
return NULL;
@@ -253,11 +253,15 @@ static true_false_string* true_false_string_from_table(lua_State* L, int idx) {
}
/* arrays in LUA start with index number 1 */
- if (lua_tointeger(L,-2) == 1)
+ if (lua_tointeger(L,-2) == 1) {
+ g_free((gchar *)tf.true_string);
tf.true_string = g_strdup(lua_tostring(L,-1));
+ }
- if (lua_tointeger(L,-2) == 2)
+ if (lua_tointeger(L,-2) == 2) {
+ g_free((gchar *)tf.false_string);
tf.false_string = g_strdup(lua_tostring(L,-1));
+ }
lua_pop(L, 1);
}