coverity fixes

remotes/origin/master
Anoop Saldanha 13 years ago committed by Victor Julien
parent e624c56c83
commit 6c5b596ada

@ -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");

@ -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;
}

@ -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)

@ -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;
}

@ -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));

Loading…
Cancel
Save