Suricata is a network Intrusion Detection System, Intrusion Prevention System and Network Security Monitoring engine developed by the OISF and the Suricata community.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Steve Grubb 60ad9d29c5 Memory leak cleanup in detectors
Hello,

I ran the code through an analysis program and found several leaks that
should be cleaned up.

*In src/detect-engine-address-ipv4.c at line 472, the test for ag == NULL
will never be true since that is the loop entry test.
*In src/detect-engine-port.c at line 1133, the test for p == NULL will
never be true since that is the loop entry test.
*In src/detect-engine-mpm.c at line 263 is a return without freeing
fast_pattern
*In src/detect-ack.c at line 80 and 85, data catches the return from malloc.
One of them should be deleted.
*In src/detect-seq.c at line 81 and 86, data catches the return from malloc.
One of them should be deleted.
*In src/detect-content.c at line 749, many of the paths that lead to the error
exit still has temp pointing to allocated memory. To clean this up, temp
should be set to NULL if not immediately assigning and new value.
*In src/detect-uricontent.c at line 319, both cd and str needto be freed. At
lines 344, str needs to be freed. And at line 347 str and temp need to be
freed.
*In src/detect-flowbits.c at line 231 and 235, str was not being freed. cd was
not being freed at line 235.
*In src/detect-flowvar.c at line 127, str was not being freed. At line 194, cd
and str were not being freed.
*In src/detect-flowint.c at line 277, sfd was not being freed. At line 315, str
was not being freed.
*In src/detect-pktvar.c at line 121, str was not being freed. At line 188, str
and cd was not being freed.
*In src/detect-pcre.c at line 389, there is an extra free of "re" that should
be deleted.
*In src/detect-depth.c at line 42 & 48, str has not been freed.
*In src/detect-distance.c at line 49 and 55, str has not been freed
*In src/detect-offset.c at line 45, str has not been freed.

The patch below fixes these issues.

-Steve
17 years ago
benches Initial add of the files. 17 years ago
doc Mention that libpfring 4.0 is required for our pfring support. 17 years ago
src Memory leak cleanup in detectors 17 years ago
COPYING Initial add of the files. 17 years ago
ChangeLog Initial add of the files. 17 years ago
LICENSE import of gplv2 LICENSE 17 years ago
Makefile.am Initial add of the files. 17 years ago
Makefile.cvs Initial add of the files. 17 years ago
acsite.m4 Added C99 defs/macros to acsite.m4 for CentOS 17 years ago
autojunk.sh Adding support for Mac OS X, FreeBSD, centrailizing mutex/spins/conditions in a macro API, and some unittests 17 years ago
config.guess Initial add of the files. 17 years ago
config.h.in build update 17 years ago
config.sub Initial add of the files. 17 years ago
configure.in Make sure pcre PCRE_EXTRA_MATCH_LIMIT_RECURSION check works with strict compiler settings. 17 years ago
depcomp Initial add of the files. 17 years ago
doxygen.cfg more project name updates 17 years ago
install-sh Initial add of the files. 17 years ago
ltmain.sh Large update: pcap support, threading fixes, initial stream tracking, time handling, pool support, runmodes, decoders added, autojunk update. 17 years ago
missing Initial add of the files. 17 years ago
mkinstalldirs Initial add of the files. 17 years ago
suricata.yaml Require that the configuration file begins with a valid YAML version. At this time this means the configuration file must begin with 17 years ago