From: Victor Julien Date: Fri, 22 Sep 2023 08:14:23 +0000 (+0200) Subject: detect/replace: minor code cleanup X-Git-Tag: suricata-8.0.0-beta1~1994 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3ac3e69d613cf8b49c6f4e2e796642ea58bfb6d;p=thirdparty%2Fsuricata.git detect/replace: minor code cleanup --- diff --git a/src/detect-replace.c b/src/detect-replace.c index e70a2e1677..a5d0387457 100644 --- a/src/detect-replace.c +++ b/src/detect-replace.c @@ -179,24 +179,20 @@ error: DetectReplaceList *DetectReplaceAddToList( DetectReplaceList *replist, uint8_t *found, const DetectContentData *cd) { - DetectReplaceList *newlist; - if (cd->content_len != cd->replace_len) return NULL; SCLogDebug("replace: Adding match"); - newlist = SCMalloc(sizeof(DetectReplaceList)); + DetectReplaceList *newlist = SCMalloc(sizeof(DetectReplaceList)); if (unlikely(newlist == NULL)) return replist; newlist->found = found; newlist->cd = cd; /* Push new value onto the front of the list. */ newlist->next = replist; - return newlist; } - void DetectReplaceExecuteInternal(Packet *p, DetectReplaceList *replist) { DetectReplaceList *tlist = NULL;