Wireshark-commits: [Wireshark-commits] master 03e13a6: wslua: fix memleaks related to Proto and Pre

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sun, 27 Jan 2019 09:43:12 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=03e13a6a9fbba7cad7dbc00a1fe1b6eb44b1c16c
Submitter: "Peter Wu <peter@xxxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

03e13a6 by Peter Wu (peter@xxxxxxxxxxxxx):

    wslua: fix memleaks related to Proto and Pref
    
    Proto objects were only freed while reloading Lua plugins, be sure to
    release these on program exit too. Fix missing deallocation of heur_list
    (matches per-protocol cleanup in proto_cleanup_base).
    
    Be sure to keep a reference to the "Pref" object after registering it to
    a Proto, otherwise it could be garbage-collected early, resulting in
    memleaks (because the preference was still in use).
    
    Fixes a lot of memory leaks reported by ASAN for tests, ten tests were
    affected by Proto_new leaks, four were affected by the new_pref leaks.
    
    Change-Id: Ica52718849a33eda614775f533dc0fcefec9cc74
    Reviewed-on: https://code.wireshark.org/review/31746
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  311d087   wslua_listener: fix memleak in tap packet callback
     add  03e13a6   wslua: fix memleaks related to Proto and Pref


Summary of changes:
 epan/epan.c              | 11 +++++++
 epan/proto.c             |  2 ++
 epan/wslua/init_wslua.c  |  4 +++
 epan/wslua/wslua.h       |  2 ++
 epan/wslua/wslua_pref.c  | 83 +++++++++++++++++++++++-------------------------
 epan/wslua/wslua_proto.c |  6 ++--
 6 files changed, 62 insertions(+), 46 deletions(-)