aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2017-09-05 18:41:19 +0200
committerMichael Mann <mmann78@netscape.net>2017-09-05 19:35:32 +0000
commit0dee5c1911337e1cb8d8836eb6aec8b8abd72fa0 (patch)
treeb78ba3b552daec406271ac863db185726b609cb3
parent970ed78492db50e7229c29530ba8aa658a0ae72a (diff)
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 <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--plugins/wimaxasncp/wimaxasncp_dict.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/wimaxasncp/wimaxasncp_dict.l b/plugins/wimaxasncp/wimaxasncp_dict.l
index a1d16b3..7e4db0b 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);
}