From 227cc082a1c709ff8cade2ff0f9397ed99d4f7d5 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 26 Oct 2009 17:09:35 +0100 Subject: [PATCH] Fix small memleak at engine init. --- src/detect.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/detect.c b/src/detect.c index e642d017c8..fbef4d6404 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1169,7 +1169,6 @@ int CreateGroupedAddrList(DetectEngineCtx *de_ctx, DetectAddressGroup *srchead, * * Start with inserting the unique groups */ for (gr = tmplist2; gr != NULL; ) { -// printf(" 2 -= U Address "); DetectAddressDataPrint(gr->ad); printf(" : "); DbgPrintSigs2(gr->sh); DetectAddressGroup *newtmp = DetectAddressGroupInit(); if (newtmp == NULL) { goto error; @@ -1191,39 +1190,15 @@ int CreateGroupedAddrList(DetectEngineCtx *de_ctx, DetectAddressGroup *srchead, DetectAddressGroupInsert(de_ctx, newhead, newtmp); next_gr = gr->next; -// DetectAddressGroupFree(gr); + DetectAddressGroupFree(gr); gr = next_gr; } + /* if present, insert the joingr that covers the rest */ if (joingr != NULL) { -// printf(" 3 -= J Address "); DetectAddressDataPrint(joingr->ad); printf(" : "); DbgPrintSigs2(joingr->sh); DetectAddressGroupInsert(de_ctx, newhead, joingr); -#if 0 - /* mark the groups that are not unique */ - DetectAddressGroup *ag = GetHeadPtr(newhead,family); - DetectAddressGroup *agr = NULL; - - for (agr = ag; agr != NULL; agr = agr->next) { - DetectAddressGroup *sgr = tmplist2; - for ( ; sgr != NULL; sgr = sgr->next) { - int r = DetectAddressCmp(agr->ad,sgr->ad); - if (r == ADDRESS_ES || r == ADDRESS_EB) { -// printf("AGR "); DetectAddressDataPrint(agr->ad);printf(" -> "); -// printf(" sgr "); DetectAddressDataPrint(sgr->ad);printf("\n"); - } - } - } -#endif } -#if 0//def DEBUG - if (SCLogDebugEnabled()) { - for (gr = newhead->ipv4_head; gr != NULL; gr = gr->next) { - printf(" 4 -= R Address "); DetectAddressDataPrint(gr->ad); printf(" : "); DbgPrintSigs2(de_ctx, gr->sh); - } - } -#endif - return 0; error: return -1;