detect/tos: minor cleanups

pull/3117/head
Victor Julien 8 years ago
parent 0c36ea64c2
commit f342b11277

@ -170,18 +170,13 @@ error:
* \retval 0 on Success. * \retval 0 on Success.
* \retval -1 on Failure. * \retval -1 on Failure.
*/ */
int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) static int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
{ {
DetectTosData *tosd; DetectTosData *tosd = DetectTosParse(arg, s->init_data->negated);
SigMatch *sm;
tosd = DetectTosParse(arg, s->init_data->negated);
if (tosd == NULL) if (tosd == NULL)
return -1; return -1;
/* Okay so far so good, lets get this into a SigMatch SigMatch *sm = SigMatchAlloc();
* and put it in the Signature. */
sm = SigMatchAlloc();
if (sm == NULL) { if (sm == NULL) {
DetectTosFree(tosd); DetectTosFree(tosd);
return -1; return -1;
@ -192,7 +187,6 @@ int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH); SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH);
s->flags |= SIG_FLAG_REQUIRE_PACKET; s->flags |= SIG_FLAG_REQUIRE_PACKET;
return 0; return 0;
} }
@ -201,7 +195,7 @@ int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
* *
* \param tosd Data to be freed. * \param tosd Data to be freed.
*/ */
void DetectTosFree(void *tosd) static void DetectTosFree(void *tosd)
{ {
SCFree(tosd); SCFree(tosd);
} }

Loading…
Cancel
Save