diff options
author | Peter Wu <peter@lekensteyn.nl> | 2019-01-24 11:46:44 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-01-25 04:53:01 +0000 |
commit | 66345f008f944820425467c9fdb17155829f6489 (patch) | |
tree | 4ba7ed338909c3ffeb8370874818584fd57d793c /file.h | |
parent | e85c8bed87821e75965fca093294c23d12ac4b21 (diff) |
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@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'file.h')
-rw-r--r-- | file.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -686,6 +686,7 @@ void cf_update_section_comment(capture_file *cf, gchar *comment); * * @param cf the capture file * @param fd the frame_data structure for the frame + * @returns A comment (use g_free to free) or NULL if there is none. */ char *cf_get_packet_comment(capture_file *cf, const frame_data *fd); |