aboutsummaryrefslogtreecommitdiffstats
path: root/file.h
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-01-24 11:46:44 +0100
committerAnders Broman <a.broman58@gmail.com>2019-01-25 04:53:01 +0000
commit66345f008f944820425467c9fdb17155829f6489 (patch)
tree4ba7ed338909c3ffeb8370874818584fd57d793c /file.h
parente85c8bed87821e75965fca093294c23d12ac4b21 (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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/file.h b/file.h
index 2e0d78704b..0d9bcb318e 100644
--- a/file.h
+++ b/file.h
@@ -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);