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.
pull/10187/head
Shivani Bhardwaj 1 year ago committed by Victor Julien
parent 778820ba06
commit 588af05565

@ -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;

@ -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;

Loading…
Cancel
Save