Wireshark-commits: [Wireshark-commits] master 88dd7e7: export_pdu.c: Fix a memory leak

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Tue, 14 Aug 2018 11:47:36 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=88dd7e734acdc48ebdf61ffcf3f93db9fb7c81dd
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

88dd7e7 by Vasil Velichkov (vvvelichkov@xxxxxxxxx):

    export_pdu.c: Fix a memory leak
    
    Allocate the exp_pdu_data using the wmem_packet_scope allocator so the
    epan_dissect_run_with_taps will free it after calling all registered tap
    listeners.
    
    valgrind --tool=memcheck --leak-check=full ./run/tshark -r sctp.pcap -U "OSI layer 3" -w exported.pcap
    
    32 bytes in 1 blocks are definitely lost in loss record 48 of 76
       at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
       by 0xB3FC3C5: g_malloc (gmem.c:99)
       by 0x68C2BE1: export_pdu_create_tags (exported_pdu.c:251)
       by 0x68C2D5E: export_pdu_create_common_tags (exported_pdu.c:231)
       by 0x70AA54E: create_exp_pdu_proto_name (packet-sctp.c:3240)
       by 0x70AA54E: export_sctp_data_chunk.part.23 (packet-sctp.c:3268)
       by 0x70AB76B: export_sctp_data_chunk (packet-sctp.c:3256)
       by 0x70AB76B: dissect_data_chunk (packet-sctp.c:3509)
    
    Change-Id: I6e247ab2861bbb053f0958faf253913b28dbcbeb
    Reviewed-on: https://code.wireshark.org/review/29126
    Reviewed-by: Pascal Quantin <pascal.quantin@xxxxxxxxx>
    Petri-Dish: Pascal Quantin <pascal.quantin@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  68c9566   WIP GTP: Make it possible to configure PDCP parameters to dissect NR_RAN_CONT
     add  88dd7e7   export_pdu.c: Fix a memory leak


Summary of changes:
 epan/exported_pdu.c | 4 ++--
 ui/tap_export_pdu.c | 1 -
 2 files changed, 2 insertions(+), 3 deletions(-)