mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Fix various potential memory leaks.
Though I expect most not to be exercised in practice.
This commit is contained in:
parent
c3a4454892
commit
0b97343ff7
29 changed files with 142 additions and 32 deletions
|
@ -1148,7 +1148,11 @@ Packet* Packet::Unserialize(UnserialInfo* info)
|
|||
UNSERIALIZE(&tv_usec) &&
|
||||
UNSERIALIZE(&len) &&
|
||||
UNSERIALIZE(&p->link_type)) )
|
||||
{
|
||||
delete p;
|
||||
delete hdr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
hdr->ts.tv_sec = tv_sec;
|
||||
hdr->ts.tv_usec = tv_usec;
|
||||
|
@ -1156,12 +1160,18 @@ Packet* Packet::Unserialize(UnserialInfo* info)
|
|||
|
||||
char* tag;
|
||||
if ( ! info->s->Read((char**) &tag, 0, "tag") )
|
||||
{
|
||||
delete p;
|
||||
delete hdr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* pkt;
|
||||
int caplen;
|
||||
if ( ! info->s->Read((char**) &pkt, &caplen, "data") )
|
||||
{
|
||||
delete p;
|
||||
delete hdr;
|
||||
delete [] tag;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue