detect/replace: minor code cleanup

pull/9939/head
Victor Julien 2 years ago committed by Victor Julien
parent 3d7e0927bf
commit a3ac3e69d6

@ -179,24 +179,20 @@ error:
DetectReplaceList *DetectReplaceAddToList( DetectReplaceList *DetectReplaceAddToList(
DetectReplaceList *replist, uint8_t *found, const DetectContentData *cd) DetectReplaceList *replist, uint8_t *found, const DetectContentData *cd)
{ {
DetectReplaceList *newlist;
if (cd->content_len != cd->replace_len) if (cd->content_len != cd->replace_len)
return NULL; return NULL;
SCLogDebug("replace: Adding match"); SCLogDebug("replace: Adding match");
newlist = SCMalloc(sizeof(DetectReplaceList)); DetectReplaceList *newlist = SCMalloc(sizeof(DetectReplaceList));
if (unlikely(newlist == NULL)) if (unlikely(newlist == NULL))
return replist; return replist;
newlist->found = found; newlist->found = found;
newlist->cd = cd; newlist->cd = cd;
/* Push new value onto the front of the list. */ /* Push new value onto the front of the list. */
newlist->next = replist; newlist->next = replist;
return newlist; return newlist;
} }
void DetectReplaceExecuteInternal(Packet *p, DetectReplaceList *replist) void DetectReplaceExecuteInternal(Packet *p, DetectReplaceList *replist)
{ {
DetectReplaceList *tlist = NULL; DetectReplaceList *tlist = NULL;

Loading…
Cancel
Save