check first that we got the mem, before we clean it
@@ -1722,22 +1722,22 @@ if(stat(pcapinname, &statinfo) != 0)
}
netdbdata = malloc(statinfo.st_size +statinfo.st_size +NETDB_SIZE);
-memset(netdbdata, 0, statinfo.st_size +statinfo.st_size +NETDB_SIZE);
if(netdbdata == NULL)
{
fprintf(stderr, "out of memory process nets\n");
exit(EXIT_FAILURE);
}
+memset(netdbdata, 0, statinfo.st_size +statinfo.st_size +NETDB_SIZE);
newnetdbdata = netdbdata;
netdbrecords = 0;
eapdbdata = malloc(statinfo.st_size +statinfo.st_size +EAPDB_SIZE);
-memset(eapdbdata, 0, statinfo.st_size +statinfo.st_size +EAPDB_SIZE);
if(eapdbdata == NULL)
{
fprintf(stderr, "out of memory process eaps\n");
exit(EXIT_FAILURE);
}
+memset(eapdbdata, 0, statinfo.st_size +statinfo.st_size +EAPDB_SIZE);
neweapdbdata = eapdbdata;
eapdbrecords = 0;
