From: Victor Julien Date: Thu, 21 Dec 2017 11:02:33 +0000 (+0100) Subject: detect/tos: minor cleanups X-Git-Tag: suricata-4.1.0-beta1~379 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f342b11277b1b3cf62c00e6a0d7fe62b7a08e930;p=thirdparty%2Fsuricata.git detect/tos: minor cleanups --- diff --git a/src/detect-tos.c b/src/detect-tos.c index 2d7c4e0a20..609ff8c866 100644 --- a/src/detect-tos.c +++ b/src/detect-tos.c @@ -170,18 +170,13 @@ error: * \retval 0 on Success. * \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; - SigMatch *sm; - - tosd = DetectTosParse(arg, s->init_data->negated); + DetectTosData *tosd = DetectTosParse(arg, s->init_data->negated); if (tosd == NULL) return -1; - /* Okay so far so good, lets get this into a SigMatch - * and put it in the Signature. */ - sm = SigMatchAlloc(); + SigMatch *sm = SigMatchAlloc(); if (sm == NULL) { DetectTosFree(tosd); return -1; @@ -192,7 +187,6 @@ int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) SigMatchAppendSMToList(s, sm, DETECT_SM_LIST_MATCH); s->flags |= SIG_FLAG_REQUIRE_PACKET; - return 0; } @@ -201,7 +195,7 @@ int DetectTosSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg) * * \param tosd Data to be freed. */ -void DetectTosFree(void *tosd) +static void DetectTosFree(void *tosd) { SCFree(tosd); }