diff options
author | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-03-14 01:08:09 +0000 |
---|---|---|
committer | Jeff Morriss <jeff.morriss@ulticom.com> | 2012-03-14 01:08:09 +0000 |
commit | 603b4d43486e6ecf06f93182a4bbee2b9678a9cb (patch) | |
tree | 26110b9e3aac7ee67a48d552fa78ee1ae3231a0d /editcap.c | |
parent | e60c1286b26e61eacfa302d815553cd977205776 (diff) |
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 'editcap.c')
-rw-r--r-- | editcap.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1155,11 +1155,15 @@ main(int argc, char *argv[]) pdh = wtap_dump_open_ng(filename, out_file_type, out_frame_type, snaplen ? MIN(snaplen, wtap_snapshot_length(wth)) : wtap_snapshot_length(wth), FALSE /* compressed */, shb_hdr, idb_inf, &err); + if (pdh == NULL) { fprintf(stderr, "editcap: Can't open or create %s: %s\n", filename, wtap_strerror(err)); exit(2); } + + g_free(idb_inf); + idb_inf = NULL; } g_assert(filename); @@ -1522,7 +1526,6 @@ main(int argc, char *argv[]) exit(2); } - g_free(idb_inf); g_free(shb_hdr); g_free(filename); } |