Skip to content

Commit

Permalink
detect/replace: minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Dec 1, 2023
1 parent 3d7e092 commit a3ac3e6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/detect-replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,24 +179,20 @@ int DetectReplaceSetup(DetectEngineCtx *de_ctx, Signature *s, const char *replac
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;
Expand Down

0 comments on commit a3ac3e6

Please sign in to comment.