summaryrefslogtreecommitdiff
path: root/wiretap/libpcap.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/libpcap.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/libpcap.c')
-rw-r--r--wiretap/libpcap.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c
index 018a35dbd3..cb9e97cf59 100644
--- a/wiretap/libpcap.c
+++ b/wiretap/libpcap.c
@@ -364,7 +364,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
* Well, we couldn't even read it.
* Give up.
*/
- g_free(wth->priv);
return -1;
case THIS_FORMAT:
@@ -373,7 +372,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
* Put the seek pointer back, and finish.
*/
if (file_seek(wth->fh, first_packet_offset, SEEK_SET, err) == -1) {
- g_free(wth->priv);
return -1;
}
goto done;
@@ -394,7 +392,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
*/
wth->file_type = WTAP_FILE_PCAP_SS990915;
if (file_seek(wth->fh, first_packet_offset, SEEK_SET, err) == -1) {
- g_free(wth->priv);
return -1;
}
} else {
@@ -416,7 +413,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
* Well, we couldn't even read it.
* Give up.
*/
- g_free(wth->priv);
return -1;
case THIS_FORMAT:
@@ -426,7 +422,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
* Put the seek pointer back, and finish.
*/
if (file_seek(wth->fh, first_packet_offset, SEEK_SET, err) == -1) {
- g_free(wth->priv);
return -1;
}
goto done;
@@ -445,7 +440,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
*/
wth->file_type = WTAP_FILE_PCAP_SS990417;
if (file_seek(wth->fh, first_packet_offset, SEEK_SET, err) == -1) {
- g_free(wth->priv);
return -1;
}
switch (libpcap_try(wth, err)) {
@@ -455,7 +449,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
* Well, we couldn't even read it.
* Give up.
*/
- g_free(wth->priv);
return -1;
case THIS_FORMAT:
@@ -464,7 +457,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
* Put the seek pointer back, and finish.
*/
if (file_seek(wth->fh, first_packet_offset, SEEK_SET, err) == -1) {
- g_free(wth->priv);
return -1;
}
goto done;
@@ -485,7 +477,6 @@ int libpcap_open(wtap *wth, int *err, gchar **err_info)
*/
wth->file_type = WTAP_FILE_PCAP_NOKIA;
if (file_seek(wth->fh, first_packet_offset, SEEK_SET, err) == -1) {
- g_free(wth->priv);
return -1;
}
}