Wireshark-commits: [Wireshark-commits] master 8018153: uat: fix memleak after parsing and on errors

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 1 Sep 2016 21:12:14 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=80181532b62c19521c658f3bb281e4956797a51c
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

8018153 by Peter Wu (peter@xxxxxxxxxxxxx):

    uat: fix memleak after parsing and on errors
    
    Memleaks could occur in these scenarios:
     - Two consecutive fields fail in their chk callback, overwriting the
       first heap-allocated error message.
     - After parsing one record, the internal record was never freed.
     - Syntax errors abort the parsing process and leaks the record and
       current field value.
    
    These leaks will only happen at startup, when the UAT files are read or
    when UAT strings are loaded (e.g. from the ssl.keys_list preference).
    
    Change-Id: I4cf7cbc8131f71493ba70916a8f60168e5d65148
    Reviewed-on: https://code.wireshark.org/review/17432
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
    

Actions performed:

    from  27164dd   E.212: update Chinese PLMN list
    adds  8018153   uat: fix memleak after parsing and on errors


Summary of changes:
 epan/uat_load.l |   39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)