Wireshark-commits: [Wireshark-commits] master-2.4 0e7ac7d: Fix another leak, which happens with -E

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 07 Mar 2018 08:51:50 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=0e7ac7d051ac40bec44f41ea9b94d91593dfcb39
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.4
Repository: wireshark

Commits:

0e7ac7d by Guy Harris (guy@xxxxxxxxxxxx):

    Fix another leak, which happens with -E occurrence=l.
    
    For each occurrence, if there was already an occurrence in the array, we
    were just removing it. not freeing what it pointed to.
    
    While we're at it, expand comments. and always check the array size with
    "!= 0", not "> 0" - the value is unsigned, so they're equivalent, but
    this makes the code more self-consistent.
    
    Change-Id: I538f46b296a7721a39ba4366c2f6269e7e097b0d
    Reviewed-on: https://code.wireshark.org/review/26328
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit 9a5217bdd4680e36f2e92838348bd4ea010d28a0)
    Reviewed-on: https://code.wireshark.org/review/26329
    

Actions performed:

    from  2e58b82   print: free memory if not used (found by clang).
    adds  0e7ac7d   Fix another leak, which happens with -E occurrence=l.


Summary of changes:
 epan/print.c | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)