mirror of
https://github.com/OISF/suricata.git
synced 2026-05-28 04:32:12 -04:00
stream: minor code cleanups
This commit is contained in:
parent
24e7f3439e
commit
9d693a72b6
1 changed files with 12 additions and 15 deletions
|
|
@ -267,9 +267,7 @@ static void *TcpSegmentPoolAlloc(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
TcpSegment *seg = NULL;
|
||||
|
||||
seg = SCMalloc(sizeof (TcpSegment));
|
||||
TcpSegment *seg = SCMalloc(sizeof(TcpSegment));
|
||||
if (unlikely(seg == NULL))
|
||||
return NULL;
|
||||
|
||||
|
|
@ -287,18 +285,17 @@ static void *TcpSegmentPoolAlloc(void)
|
|||
"TcpSegmentPcapHdrStorage");
|
||||
SCFree(seg);
|
||||
return NULL;
|
||||
} else {
|
||||
seg->pcap_hdr_storage->alloclen = sizeof(uint8_t) * TCPSEG_PKT_HDR_DEFAULT_SIZE;
|
||||
seg->pcap_hdr_storage->pkt_hdr =
|
||||
SCCalloc(1, sizeof(uint8_t) * TCPSEG_PKT_HDR_DEFAULT_SIZE);
|
||||
if (seg->pcap_hdr_storage->pkt_hdr == NULL) {
|
||||
SCLogDebug("Unable to allocate memory for "
|
||||
"packet header data within "
|
||||
"TcpSegmentPcapHdrStorage");
|
||||
SCFree(seg->pcap_hdr_storage);
|
||||
SCFree(seg);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
seg->pcap_hdr_storage->alloclen = sizeof(uint8_t) * TCPSEG_PKT_HDR_DEFAULT_SIZE;
|
||||
seg->pcap_hdr_storage->pkt_hdr = SCCalloc(1, sizeof(uint8_t) * TCPSEG_PKT_HDR_DEFAULT_SIZE);
|
||||
if (seg->pcap_hdr_storage->pkt_hdr == NULL) {
|
||||
SCLogDebug("Unable to allocate memory for "
|
||||
"packet header data within "
|
||||
"TcpSegmentPcapHdrStorage");
|
||||
SCFree(seg->pcap_hdr_storage);
|
||||
SCFree(seg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
StreamTcpReassembleIncrMemuse(memuse);
|
||||
|
|
|
|||
Loading…
Reference in a new issue