diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 9f5d1b5578..ac5c5037d6 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -307,6 +307,15 @@ int netmon_open(wtap *wth, int *err, gchar **err_info) netmon->version_major = hdr.ver_major; netmon->version_minor = hdr.ver_minor; + /* + * No frame table allocated yet; initialize these in case we + * get an error before allocating it or when trying to allocate + * it, so that the attempt to release the private data on failure + * doesn't crash. + */ + netmon->frame_table_size = 0; + netmon->frame_table = NULL; + /* * Get the offset of the frame index table. */