From 0dee5c1911337e1cb8d8836eb6aec8b8abd72fa0 Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Tue, 5 Sep 2017 18:41:19 +0200 Subject: Fix memory leak in wimaxasncp Remove unnecessary null-check before free as well. Change-Id: Ic54459149b40fd8c8f58c643bbd6cfc81ee8b923 Reviewed-on: https://code.wireshark.org/review/23398 Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- plugins/wimaxasncp/wimaxasncp_dict.l | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/wimaxasncp/wimaxasncp_dict.l b/plugins/wimaxasncp/wimaxasncp_dict.l index a1d16b3329..7e4db0b8fd 100644 --- a/plugins/wimaxasncp/wimaxasncp_dict.l +++ b/plugins/wimaxasncp/wimaxasncp_dict.l @@ -794,7 +794,7 @@ wimaxasncp_dict_t *wimaxasncp_dict_scan( void wimaxasncp_dict_free(wimaxasncp_dict_t *d) { wimaxasncp_dict_tlv_t *t, *tn; -#define FREE_NAMEANDOBJ(n) do { if(n->name) g_free(n->name); g_free(n); } while(0) +#define FREE_NAMEANDOBJ(n) do { g_free(n->name); g_free(n); } while(0) for (t = d->tlvs; t; t = tn) { wimaxasncp_dict_enum_t *e, *en; @@ -805,7 +805,7 @@ void wimaxasncp_dict_free(wimaxasncp_dict_t *d) { FREE_NAMEANDOBJ(e); } - if (!t->description) g_free(t->description); + g_free(t->description); FREE_NAMEANDOBJ(t); } -- cgit v1.2.3