From: Victor Julien Date: Fri, 20 May 2016 16:45:16 +0000 (+0200) Subject: coverity: CID 1362011: Control flow issues (DEADCODE) X-Git-Tag: suricata-3.1RC1~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1df5acb001dfb85f61d7a530a748a641a4055903;p=thirdparty%2Fsuricata.git coverity: CID 1362011: Control flow issues (DEADCODE) --- diff --git a/src/app-layer-htp-body.c b/src/app-layer-htp-body.c index b4ba2ffbea..bfb9ba73af 100644 --- a/src/app-layer-htp-body.c +++ b/src/app-layer-htp-body.c @@ -96,8 +96,9 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body, if (body->first == NULL) { /* New chunk */ bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk)); - if (bd == NULL) - goto error; + if (bd == NULL) { + SCReturnInt(-1); + } StreamingBufferAppend(body->sb, &bd->sbseg, data, len); @@ -106,8 +107,9 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body, body->content_len_so_far = len; } else { bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk)); - if (bd == NULL) - goto error; + if (bd == NULL) { + SCReturnInt(-1); + } StreamingBufferAppend(body->sb, &bd->sbseg, data, len); @@ -119,12 +121,6 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body, SCLogDebug("body %p", body); SCReturnInt(0); - -error: - if (bd != NULL) { - HTPFree(bd, sizeof(HtpBodyChunk)); - } - SCReturnInt(-1); } /**