summaryrefslogtreecommitdiff
path: root/wiretap
diff options
context:
space:
mode:
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/pcapng.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/wiretap/pcapng.c b/wiretap/pcapng.c
index f997133feb..6660987a4c 100644
--- a/wiretap/pcapng.c
+++ b/wiretap/pcapng.c
@@ -2199,8 +2199,7 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
pn.if_fcslen = -1;
pn.version_major = -1;
pn.version_minor = -1;
- pn.interfaces = g_array_new(FALSE, FALSE, sizeof(interface_info_t));
-
+ pn.interfaces = NULL;
/* we don't expect any packet blocks yet */
wblock.frame_buffer = NULL;
@@ -2243,9 +2242,8 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
/*
* At this point, we've decided this is a pcap-NG file, not
- * some other type of file, so we can't return 0, as that
- * means "this isn't a pcap-NG file, try some other file
- * type".
+ * some other type of file, so we can't return WTAP_OPEN_NOT_MINE
+ * past this point.
*/
wth->shb_hdr.opt_comment = wblock.data.section.opt_comment;
wth->shb_hdr.shb_hardware = wblock.data.section.shb_hardware;
@@ -2258,6 +2256,7 @@ pcapng_open(wtap *wth, int *err, gchar **err_info)
pcapng = (pcapng_t *)g_malloc(sizeof(pcapng_t));
wth->priv = (void *)pcapng;
*pcapng = pn;
+ pcapng->interfaces = g_array_new(FALSE, FALSE, sizeof(interface_info_t));
wth->subtype_read = pcapng_read;
wth->subtype_seek_read = pcapng_seek_read;