Opened 13 years ago
Last modified 13 years ago
#3831 new defect
memory leaks in graticule layer
Reported by: | tbonfort | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 6.0 release |
Component: | MapServer C Library | Version: | svn-trunk (development) |
Severity: | normal | Keywords: | |
Cc: |
Description
valgrind reports 3 distinct memory leaks for graticule layers:
==16155== 3 bytes in 1 blocks are definitely lost in loss record 1 of 5 ==16155== at 0x4C2815C: malloc (vg_replace_malloc.c:236) ==16155== by 0xBDACB81: strdup (strdup.c:43) ==16155== by 0x445919: msStrdup (mapstring.c:2117) ==16155== by 0x448753: loadGrid (mapfile.c:973) ==16155== by 0x45224D: loadLayer (mapfile.c:3676) ==16155== by 0x459A9F: loadMapInternal (mapfile.c:5388) ==16155== by 0x45A5CC: msLoadMap (mapfile.c:5653) ==16155== by 0x441B0A: main (shp2img.c:129)
==16090== 4,112 bytes in 1 blocks are indirectly lost in loss record 6 of 7 ==16090== at 0x4C2815C: malloc (vg_replace_malloc.c:236) ==16090== by 0x461E61: msSmallMalloc (maputil.c:2152) ==16090== by 0x4A2FAF: msGraticuleLayerNextShape (mapgraticule.c:453) ==16090== by 0x484D23: msLayerNextShape (maplayer.c:164) ==16090== by 0x48AE84: msDrawVectorLayer (mapdraw.c:843) ==16090== by 0x48A010: msDrawLayer (mapdraw.c:730) ==16090== by 0x489193: msDrawMap (mapdraw.c:422) ==16090== by 0x44255E: main (shp2img.c:299) ==16090== ==16090== 4,128 (16 direct, 4,112 indirect) bytes in 1 blocks are definitely lost in loss record 7 of 7 ==16090== at 0x4C2815C: malloc (vg_replace_malloc.c:236) ==16090== by 0x461E61: msSmallMalloc (maputil.c:2152) ==16090== by 0x4A2571: msGraticuleLayerNextShape (mapgraticule.c:299) ==16090== by 0x484D23: msLayerNextShape (maplayer.c:164) ==16090== by 0x48AE84: msDrawVectorLayer (mapdraw.c:843) ==16090== by 0x48A010: msDrawLayer (mapdraw.c:730) ==16090== by 0x489193: msDrawMap (mapdraw.c:422) ==16090== by 0x44255E: main (shp2img.c:299)
and
==14776== 184 bytes in 1 blocks are definitely lost in loss record 6 of 8 ==14776== at 0x4C2815C: malloc (vg_replace_malloc.c:236) ==14776== by 0x4521D6: loadLayer (mapfile.c:3672) ==14776== by 0x459A82: loadMapInternal (mapfile.c:5387) ==14776== by 0x45A5AF: msLoadMap (mapfile.c:5652) ==14776== by 0x441B0A: main (shp2img.c:129)
Attached is a patch for the last two, I don't understand where the first one is coming from, it's when strduping DD:
case( LABELFORMAT ): if(getString(&((graticuleObj *)pLayer->layerinfo)->labelformat) == MS_FAILURE) { if(strcasecmp(msyystring_buffer, "DD") == 0) /* DD triggers a symbol to be returned instead of a string so check for this special case */ ((graticuleObj *)pLayer->layerinfo)->labelformat = msStrdup("DD");
not sure who I should assign this bug to as the graticule maintainer isn't active anymore
Change History (4)
comment:1 by , 13 years ago
comment:3 by , 13 years ago
I applied your patch in r11565. Do you have the mapfile you were using to generate the leaks? -Steve
Note:
See TracTickets
for help on using tickets.
the patch for the last two leaks: