[Snort-devel] [ snort-Bugs-612185 ] Memory leaks

noreply at ...12... noreply at ...12...
Wed Sep 25 12:23:14 EDT 2002


Bugs item #612185, was opened at 2002-09-20 18:07
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103357&aid=612185&group_id=3357

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: WG (wgxxx)
Assigned to: Nobody/Anonymous (nobody)
Summary: Memory leaks

Initial Comment:
Hello,

I just used valgrind to look on the memory leaks. I'll
add the output as attachment. (latest CVS!)


I'll just have a question to mSplit:
In mSplit (mstring.c) retstr is returned. It is
produced  with
    if((retstr = (char **) malloc((sizeof(char **) *
max_strs))) == NULL)
        FatalPrintError("malloc");
Then the specific terms are malloc'd with:
... malloc((sizeof(char) * len) + 1)) == NULL)


In the part of the source, where mSplit is executed, it
is freed:
for(i=0;i<num_toks;i++)
    {
        free(toks[i]);
    }

Do you need a free(toks) ???

Maybe it is a stupid question, but I'm not so firm in c!

Is it the goal here, that all mallocs are freed at end?

Greetings
Georg 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=103357&aid=612185&group_id=3357




More information about the Snort-devel mailing list