Wireshark-commits: [Wireshark-commits] master 66345f0: Fix memory ownership when using cf_get_packe

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 25 Jan 2019 04:53:08 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=66345f008f944820425467c9fdb17155829f6489
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

66345f0 by Peter Wu (peter@xxxxxxxxxxxxx):

    Fix memory ownership when using cf_get_packet_comment
    
    cf_get_packet_comment already has one code path that returns duplicated
    memory. Be sure to document the requirement to free this memory and
    adjust Qt to avoid memory leaks.
    
    Be firm and assume that wth.opt_comment is owned by wth, so duplicate it
    before returning it from cf_get_packet_comment.
    
    Change-Id: I91f406296c9db5ea21b90fc2e108c37de4528527
    Ping-Bug: 7515
    Reviewed-on: https://code.wireshark.org/review/31712
    Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Vasil Velichkov <vvvelichkov@xxxxxxxxx>
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  e85c8be   tshark: fix crash with -Tjson and -e field
     add  66345f0   Fix memory ownership when using cf_get_packet_comment


Summary of changes:
 file.c                                   | 3 ++-
 file.h                                   | 1 +
 ui/qt/capture_file_properties_dialog.cpp | 2 +-
 ui/qt/packet_list.cpp                    | 5 ++---
 4 files changed, 6 insertions(+), 5 deletions(-)