summaryrefslogtreecommitdiff
path: root/wiretap/nettl.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-03-25 22:04:15 +0000
committerEvan Huus <eapache@gmail.com>2013-03-25 22:04:15 +0000
commit202680971de2da8c7939e3eb490c4a8be2455d6b (patch)
treebe91902bf2e94fbe2d6b2e22846c6f8bf9fa177b /wiretap/nettl.c
parent93be2ad48ae63557378292f82854d93fb14b4305 (diff)
downloadwireshark-202680971de2da8c7939e3eb490c4a8be2455d6b.tar.gz
Wiretap file open routines should not free wth->priv on error, since that
leads to a double-free in wtap_close. Fix all the instances I found via manual code review, and add a brief comment to the list of open routines in file_access.c Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8518 svn path=/trunk/; revision=48552
Diffstat (limited to 'wiretap/nettl.c')
-rw-r--r--wiretap/nettl.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/wiretap/nettl.c b/wiretap/nettl.c
index 1fa4034f24..564644426e 100644
--- a/wiretap/nettl.c
+++ b/wiretap/nettl.c
@@ -241,18 +241,12 @@ int nettl_open(wtap *wth, int *err, gchar **err_info)
bytes_read = file_read(dummy, 4, wth->fh);
if (bytes_read != 4) {
if (*err != 0) {
- wth->priv = NULL;
- g_free(nettl);
return -1;
}
if (bytes_read != 0) {
*err = WTAP_ERR_SHORT_READ;
- wth->priv = NULL;
- g_free(nettl);
return -1;
}
- wth->priv = NULL;
- g_free(nettl);
return 0;
}
@@ -290,7 +284,6 @@ int nettl_open(wtap *wth, int *err, gchar **err_info)
}
if (file_seek(wth->fh, FILE_HDR_SIZE, SEEK_SET, err) == -1) {
- g_free(nettl);
return -1;
}
wth->tsprecision = WTAP_FILE_TSPREC_USEC;