From 588af05565e2f52f5b1f758312e18c1567dbb993 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Tue, 16 Jan 2024 14:10:59 +0530 Subject: [PATCH] detect: remove unneeded size in DetectEngineCtx 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 | 4 ---- src/detect.h | 1 - 2 files changed, 5 deletions(-) diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index 6a1c531136..604164b21c 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -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; diff --git a/src/detect.h b/src/detect.h index 181ae22923..9b7b58794e 100644 --- a/src/detect.h +++ b/src/detect.h @@ -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; -- 2.47.2