diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 8545343977..d4f2b8b0be 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -1230,6 +1230,7 @@ void AppLayerListSupportedProtocols(void) { uint32_t i; uint32_t temp_alprotos_buf[ALPROTO_MAX]; + memset(temp_alprotos_buf, 0, sizeof(temp_alprotos_buf)); printf("=========Supported App Layer Protocols=========\n"); diff --git a/src/decode-udp.h b/src/decode-udp.h index 4f24892d60..037a91f3b4 100644 --- a/src/decode-udp.h +++ b/src/decode-udp.h @@ -189,8 +189,6 @@ static inline uint16_t UDPV6CalculateChecksum(uint16_t *shdr, uint16_t *pkt, return 0xFFFF; else return csum_u16; - - return (uint16_t)~csum; } diff --git a/src/flow-timeout.c b/src/flow-timeout.c index 3d2920a255..669d52228a 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -487,7 +487,11 @@ static inline void FlowForceReassemblyForHash(void) StreamTcpReassembleHandleSegment(stream_pseudo_pkt_stream_TV, stt->ra_ctx, ssn, &ssn->server, reassemble_p, NULL); - StreamTcpReassembleProcessAppLayer(stt->ra_ctx); + if (StreamTcpReassembleProcessAppLayer(stt->ra_ctx) < 0) { + SCLogDebug("shutdown flow timeout " + "StreamTcpReassembleProcessAppLayer() erroring " + "over something"); + } } /* oh oh! We have some unattended toclient segments */ if ((server_ok = StreamHasUnprocessedSegments(ssn, 1)) == 1) { @@ -500,7 +504,11 @@ static inline void FlowForceReassemblyForHash(void) StreamTcpReassembleHandleSegment(stream_pseudo_pkt_stream_TV, stt->ra_ctx, ssn, &ssn->client, reassemble_p, NULL); - StreamTcpReassembleProcessAppLayer(stt->ra_ctx); + if (StreamTcpReassembleProcessAppLayer(stt->ra_ctx) < 0) { + SCLogDebug("shutdown flow timeout " + "StreamTcpReassembleProcessAppLayer() erroring " + "over something"); + } } if (ssn->state >= TCP_ESTABLISHED && ssn->state != TCP_CLOSED) diff --git a/src/log-pcap.c b/src/log-pcap.c index 023d9ec045..05f31df227 100644 --- a/src/log-pcap.c +++ b/src/log-pcap.c @@ -417,8 +417,7 @@ OutputCtx *PcapLogInitCtx(ConfNode *conf) filename = DEFAULT_LOG_FILENAME; if ((pl->prefix = SCStrdup(filename)) == NULL) { - SCLogError(SC_ERR_MEM_ALLOC, "Error allocating memory for directory name"); - return NULL; + exit(EXIT_FAILURE); } pl->size_limit = DEFAULT_LIMIT; @@ -576,6 +575,9 @@ OutputCtx *PcapLogInitCtx(ConfNode *conf) static void PcapLogFileDeInitCtx(OutputCtx *output_ctx) { + if (output_ctx == NULL) + return; + PcapLogData *pl = output_ctx->data; PcapFileName *pf = NULL; @@ -583,10 +585,6 @@ static void PcapLogFileDeInitCtx(OutputCtx *output_ctx) SCLogDebug("PCAP files left at exit: %s\n", pf->filename); } - if (output_ctx != NULL) { - SCFree(output_ctx); - } - return; } diff --git a/src/tmqh-flow.c b/src/tmqh-flow.c index 1382e5b60a..a78c471f5c 100644 --- a/src/tmqh-flow.c +++ b/src/tmqh-flow.c @@ -119,10 +119,10 @@ static int StoreQueueId(TmqhFlowCtx *ctx, char *name) if (ctx->queues == NULL) { ctx->size = 1; ctx->queues = SCMalloc(ctx->size * sizeof(TmqhFlowMode)); - memset(ctx->queues, 0, ctx->size * sizeof(TmqhFlowMode)); if (ctx->queues == NULL) { return -1; } + memset(ctx->queues, 0, ctx->size * sizeof(TmqhFlowMode)); } else { ctx->size++; ctx->queues = SCRealloc(ctx->queues, ctx->size * sizeof(TmqhFlowMode));