igmp: fix memleak

dissector_add_uint_range walks through ranges and then does not need the
range anymore. Discovered with `tshark -G fields` and GCC 5.1 + ASAN.

Change-Id: I76f98a6ccee6dbbecc1efb847c358bd6d010e1dc
Reviewed-on: https://code.wireshark.org/review/8825
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Peter Wu 2015-06-07 23:21:14 +02:00 committed by Anders Broman
parent 5472e4d6e9
commit 2c56c6fa76
1 changed files with 2 additions and 1 deletions

View File

@ -1116,7 +1116,7 @@ proto_reg_handoff_igmp(void)
{
dissector_handle_t igmp_handle, igmpv0_handle, igmpv1_handle, igmpv2_handle,
igmp_mquery_handle, igmp_mtrace_handle, igmp_report_handle;
range_t *igmpv0_range;
range_t *igmpv0_range = NULL;
igmp_handle = create_dissector_handle(dissect_igmp, proto_igmp);
dissector_add_uint("ip.proto", IP_PROTO_IGMP, igmp_handle);
@ -1125,6 +1125,7 @@ proto_reg_handoff_igmp(void)
range_convert_str(&igmpv0_range, "0-15", 15);
igmpv0_handle = new_create_dissector_handle(dissect_igmp_v0, proto_igmp);
dissector_add_uint_range("igmp.type", igmpv0_range, igmpv0_handle);
g_free(igmpv0_range);
/* IGMP v1 */
igmpv1_handle = new_create_dissector_handle(dissect_igmp_v1, proto_igmp);