Ticket #901 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

memory leaks from msSHPOpen

Reported by: sgillies@… Owned by: sdlime
Priority: high Milestone: 4.4 release
Component: MapServer C Library Version: 4.3
Severity: normal Keywords:
Cc:

Description

Valgrind shows memory leaking from msSHPOpen.

[sean@lenny python]$ valgrind --tool=memcheck
--suppressions=/home/sean/projects/valgrind-python.supp --num-callers=10
--leak-check=yes python tests/cases/maptest.py

...
==5709== 146 bytes in 2 blocks are definitely lost in loss record 56 of 84
==5709==    at 0x1B904A80: malloc (vg_replace_malloc.c:131)
==5709==    by 0x1C2EF8F7: msSHPOpen (mapshape.c:217)
==5709==    by 0x1C2F22BD: msSHPOpenFile (mapshape.c:1340)
==5709==    by 0x1C31AC73: msLayerOpen (maplayer.c:134)
==5709==    by 0x1C3237BB: msDrawVectorLayer (mapdraw.c:704)
==5709==    by 0x1C323595: msDrawLayer (mapdraw.c:626)
==5709==    by 0x1C322BC4: msDrawMap (mapdraw.c:321)
==5709==    by 0x1C2B702E: mapObj_draw (mapscript_wrap.c:1460)
==5709==    by 0x1C2D66D4: _wrap_mapObj_draw (mapscript_wrap.c:17246)
==5709==    by 0x80EA40C: PyCFunction_Call (in /usr/bin/python)
==5709==

Change History

Changed 9 years ago by sgillies@…

  • milestone set to 4.4 release

Changed 9 years ago by sgillies@…

  • status changed from new to closed
  • resolution set to fixed
This leaks occurred because shpfile, psSHP, pszBasename, pszFullname were not
being freed before exiting from an error state.  Is fixed in 4.2 and the 
CVS HEAD.
 
Note: See TracTickets for help on using tickets.