coverity: CID 1362011: Control flow issues (DEADCODE)

pull/2092/head
Victor Julien 10 years ago
parent 213f041c97
commit 1df5acb001

@ -96,8 +96,9 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body,
if (body->first == NULL) { if (body->first == NULL) {
/* New chunk */ /* New chunk */
bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk)); bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk));
if (bd == NULL) if (bd == NULL) {
goto error; SCReturnInt(-1);
}
StreamingBufferAppend(body->sb, &bd->sbseg, data, len); StreamingBufferAppend(body->sb, &bd->sbseg, data, len);
@ -106,8 +107,9 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body,
body->content_len_so_far = len; body->content_len_so_far = len;
} else { } else {
bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk)); bd = (HtpBodyChunk *)HTPCalloc(1, sizeof(HtpBodyChunk));
if (bd == NULL) if (bd == NULL) {
goto error; SCReturnInt(-1);
}
StreamingBufferAppend(body->sb, &bd->sbseg, data, len); StreamingBufferAppend(body->sb, &bd->sbseg, data, len);
@ -119,12 +121,6 @@ int HtpBodyAppendChunk(const HTPCfgDir *hcfg, HtpBody *body,
SCLogDebug("body %p", body); SCLogDebug("body %p", body);
SCReturnInt(0); SCReturnInt(0);
error:
if (bd != NULL) {
HTPFree(bd, sizeof(HtpBodyChunk));
}
SCReturnInt(-1);
} }
/** /**

Loading…
Cancel
Save