]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
reputation: minor cleanup
authorVictor Julien <vjulien@oisf.net>
Mon, 13 May 2024 12:37:02 +0000 (14:37 +0200)
committerVictor Julien <victor@inliniac.net>
Sun, 7 Jul 2024 05:10:42 +0000 (07:10 +0200)
No need to init ptrs to NULL after SCCalloc.

(cherry picked from commit 3e46c516514cde867f34723a77958e8fd10bebb5)

src/reputation.c

index cd517464904beb71ab63a0a803bfbdb366338f26..dde42b09d381d80ea7c391d091e4105938224487 100644 (file)
@@ -587,7 +587,6 @@ int SRepInit(DetectEngineCtx *de_ctx)
     ConfNode *file = NULL;
     const char *filename = NULL;
     int init = 0;
-    int i = 0;
 
     de_ctx->srepCIDR_ctx = (SRepCIDRTree *)SCMalloc(sizeof(SRepCIDRTree));
     if (de_ctx->srepCIDR_ctx == NULL)
@@ -595,11 +594,6 @@ int SRepInit(DetectEngineCtx *de_ctx)
     memset(de_ctx->srepCIDR_ctx, 0, sizeof(SRepCIDRTree));
     SRepCIDRTree *cidr_ctx = de_ctx->srepCIDR_ctx;
 
-    for (i = 0; i < SREP_MAX_CATS; i++) {
-        cidr_ctx->srepIPV4_tree[i] = NULL;
-        cidr_ctx->srepIPV6_tree[i] = NULL;
-    }
-
     if (SRepGetVersion() == 0) {
         SC_ATOMIC_INIT(srep_eversion);
         init = 1;