summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-06-30 00:32:25 +0200
committerAnders Broman <a.broman58@gmail.com>2017-06-30 07:12:49 +0000
commita5b06c27bdcb5687c42c4395da9cd1aa2e722fe1 (patch)
tree0102d342f45ea96ff62db4ba3dd0b4f80ba57dd7
parentd813fa7c00f84dda8dff7d922cb9b3d75ec7f8cf (diff)
downloadwireshark-a5b06c27bdcb5687c42c4395da9cd1aa2e722fe1.tar.gz
dumpcap: fix minor memory leak at begin of capture
While "os_info_str" is freed after the loop, "cpu_info_str" was leaked. Change-Id: Ia4069403c0a5dd5cc6bd7ed61726c1bfa9736b19 Reviewed-on: https://code.wireshark.org/review/22465 Reviewed-by: Anders Broman <a.broman58@gmail.com> (cherry picked from commit 247446539704aee99f64e73a77e5e88a40ae885a) Reviewed-on: https://code.wireshark.org/review/22468
-rw-r--r--dumpcap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dumpcap.c b/dumpcap.c
index a1d20722db..6f28630b7f 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -2508,6 +2508,7 @@ capture_loop_init_output(capture_options *capture_opts, loop_data *ld, char *err
-1, /* section_length */
&ld->bytes_written,
&err);
+ g_string_free(cpu_info_str, TRUE);
g_free(appname);
for (i = 0; successful && (i < capture_opts->ifaces->len); i++) {
@@ -3009,6 +3010,7 @@ do_file_switch_or_stop(capture_options *capture_opts,
-1, /* section_length */
&(global_ld.bytes_written),
&global_ld.err);
+ g_string_free(cpu_info_str, TRUE);
g_free(appname);
for (i = 0; successful && (i < capture_opts->ifaces->len); i++) {