aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/lanalyzer.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/lanalyzer.c
parent93be2ad48ae63557378292f82854d93fb14b4305 (diff)
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/lanalyzer.c')
-rw-r--r--wiretap/lanalyzer.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c
index c3ed8f2efa..e8335c91ea 100644
--- a/wiretap/lanalyzer.c
+++ b/wiretap/lanalyzer.c
@@ -358,8 +358,6 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
*err = file_error(wth->fh, err_info);
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
- g_free(wth->priv);
- wth->priv = NULL;
return -1;
}
@@ -377,8 +375,6 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
*err = file_error(wth->fh, err_info);
if (*err == 0)
*err = WTAP_ERR_SHORT_READ;
- g_free(wth->priv);
- wth->priv = NULL;
return -1;
}
@@ -419,8 +415,6 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
wth->file_encap = WTAP_ENCAP_TOKEN_RING;
break;
default:
- g_free(wth->priv);
- wth->priv = NULL;
*err = WTAP_ERR_UNSUPPORTED_ENCAP;
*err_info = g_strdup_printf("lanalyzer: board type %u unknown",
board_type);
@@ -433,16 +427,12 @@ int lanalyzer_open(wtap *wth, int *err, gchar **err_info)
/* Go back header number of bytes so that lanalyzer_read
* can read this header */
if (file_seek(wth->fh, -LA_RecordHeaderSize, SEEK_CUR, err) == -1) {
- g_free(wth->priv);
- wth->priv = NULL;
return -1;
}
return 1;
default:
if (file_seek(wth->fh, record_length, SEEK_CUR, err) == -1) {
- g_free(wth->priv);
- wth->priv = NULL;
return -1;
}
break;