Skip to content

Commit

Permalink
igmp: fix memleak
Browse files Browse the repository at this point in the history
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 <[email protected]>
Petri-Dish: Peter Wu <[email protected]>
Tested-by: Petri Dish Buildbot <[email protected]>
Reviewed-by: Anders Broman <[email protected]>
  • Loading branch information
Lekensteyn authored and AndersBroman committed Jun 8, 2015
1 parent 5472e4d commit 2c56c6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion epan/dissectors/packet-igmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 2c56c6f

Please sign in to comment.