ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-commits: [Wireshark-commits] master 69e2603: ftypes: fix memleak when converting protocol

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 25 Apr 2018 06:56:06 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=69e2603c48d04a675785d9e7bad162ebb9a83b07
Submitter: Anders Broman (a.broman58@xxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

69e2603 by Peter Wu (peter@xxxxxxxxxxxxx):

    ftypes: fix memleak when converting protocol values
    
    When converting byte array strings to a FT_PROTOCOL value (for example,
    when using a display filter such as `eth contains aa:bb`), the converted
    memory in GByteArray was not freed. If an error occurred (the value
    cannot be parsed as hex string), then an error message was leaked.
    
    Fix the above issues and avoid an unnecessary g_memdup.
    
    Change-Id: I3a076b3a2384b1a0e15ea8518f2e0f66a7b6ea49
    Reviewed-on: https://code.wireshark.org/review/27130
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  35d9604   dfilter: fix small leak for filters containing ranges
    adds  69e2603   ftypes: fix memleak when converting protocol values


Summary of changes:
 epan/ftypes/ftype-protocol.c | 35 +++++++++++++++++------------------
 1 file changed, 17 insertions(+), 18 deletions(-)