MapServer / MapServer-import

3 stars 2 forks source link

Memory leaks in msWFSDispatch() #758

Open tbonfort opened 12 years ago

tbonfort commented 12 years ago

Reporter: dmorissette Date: 2004/07/07 - 00:10

It seems that msWFSDispatch() is systematically leaking its wfsParamsObj. Worse:
this happens even for non-WFS requests.

Here is the Valgring excerpt on a regular CGI request (non-WFS request) using
today's mapserv 4.3 CVS:

==5603== 32 bytes in 1 blocks are definitely lost in loss record 4 of 11
==5603==    at 0x401617F2: calloc (vg_clientfuncs.c:245)
==5603==    by 0x8091666: msWFSCreateParamsObj (mapwfs.c:1278)
==5603==    by 0x80913F1: msWFSDispatch (mapwfs.c:1179)
==5603==    by 0x808EC16: msOWSDispatch (mapows.c:156)
==5603==    by 0x804FC00: main (mapserv.c:946)
==5603==    by 0x4090AAB6: __libc_start_main (in /lib/libc-2.3.2.so)
==5603==    by 0x804D218: ??? (start.S:81)
==5603==

The whole msWFSDispatch() function needs to be reviewed to properly cleanup at
all its return points (there are 12 return points).
tbonfort commented 12 years ago

Author: assefa Date: 2004/07/07 - 16:51

Looking into it.
tbonfort commented 12 years ago

Author: assefa Date: 2004/07/07 - 20:42

Memory leak fixed and tested using Purify.
tbonfort commented 12 years ago

Author: dmorissette Date: 2004/07/07 - 20:53

Verified with Valgrind (at least with the test case that I had).