summaryrefslogtreecommitdiff
path: root/tshark.c
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2012-03-14 01:08:09 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2012-03-14 01:08:09 +0000
commit603b4d43486e6ecf06f93182a4bbee2b9678a9cb (patch)
tree26110b9e3aac7ee67a48d552fa78ee1ae3231a0d /tshark.c
parente60c1286b26e61eacfa302d815553cd977205776 (diff)
downloadwireshark-603b4d43486e6ecf06f93182a4bbee2b9678a9cb.tar.gz
Don't free idb_inf in wtap_dump_open_ng(): free it in the callers. This fixes the double-free editcap crashes that the buildbot's been seeing lately.
svn path=/trunk/; revision=41542
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tshark.c b/tshark.c
index d1cd96f470..1918ae1e3a 100644
--- a/tshark.c
+++ b/tshark.c
@@ -2711,6 +2711,9 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
pdh = wtap_dump_open_ng(save_file, out_file_type, linktype, snapshot_length,
FALSE /* compressed */, shb_hdr, idb_inf, &err);
+ g_free(idb_inf);
+ idb_inf = NULL;
+
if (pdh == NULL) {
/* We couldn't set up to write to the capture file. */
switch (err) {
@@ -2833,7 +2836,6 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
break;
}
wtap_dump_close(pdh, &err);
- g_free(idb_inf);
g_free(shb_hdr);
exit(2);
}
@@ -2885,7 +2887,6 @@ load_cap_file(capture_file *cf, char *save_file, int out_file_type,
break;
}
wtap_dump_close(pdh, &err);
- g_free(idb_inf);
g_free(shb_hdr);
exit(2);
}
@@ -2993,7 +2994,6 @@ out:
cf->wth = NULL;
g_free(save_file_string);
- g_free(idb_inf);
g_free(shb_hdr);
return err;