]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: remove unneeded size in DetectEngineCtx
authorShivani Bhardwaj <shivani@oisf.net>
Tue, 16 Jan 2024 08:40:59 +0000 (14:10 +0530)
committerVictor Julien <victor@inliniac.net>
Wed, 17 Jan 2024 16:20:30 +0000 (17:20 +0100)
sig_array_size can easily be calculated with length and is only used at
one place for debugging purposes. Remove it from the DetectEngineCtx
struct to avoid making it unnecessarily heavy.

src/detect-engine-build.c
src/detect.h

index 6a1c5311360135a31846ba08f9caff479777d49e..604164b21c15e403353c0912d04877c066030c44 100644 (file)
@@ -1361,14 +1361,10 @@ int SigPrepareStage1(DetectEngineCtx *de_ctx)
     }
 
     de_ctx->sig_array_len = DetectEngineGetMaxSigId(de_ctx);
-    de_ctx->sig_array_size = (de_ctx->sig_array_len * sizeof(Signature *));
     de_ctx->sig_array = (Signature **)SCCalloc(de_ctx->sig_array_len, sizeof(Signature *));
     if (de_ctx->sig_array == NULL)
         goto error;
 
-    SCLogDebug("signature lookup array: %" PRIu32 " sigs, %" PRIu32 " bytes",
-               de_ctx->sig_array_len, de_ctx->sig_array_size);
-
     /* now for every rule add the source group */
     for (Signature *s = de_ctx->sig_list; s != NULL; s = s->next) {
         de_ctx->sig_array[s->num] = s;
index 181ae229230662ad550ce99ea1b97c9781685fe2..9b7b58794e6fc581f5102e8981a269dbd99aa51a 100644 (file)
@@ -850,7 +850,6 @@ typedef struct DetectEngineCtx_ {
     SRepCIDRTree *srepCIDR_ctx;
 
     Signature **sig_array;
-    uint32_t sig_array_size; /* size in bytes */
     uint32_t sig_array_len;  /* size in array members */
 
     uint32_t signum;