Opened 13 years ago
Last modified 13 years ago
#3985 new defect
msAppendSymbol causes memory leak
Reported by: | szigeti | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 6.0.2 release |
Component: | MapServer C Library | Version: | 6.0 |
Severity: | normal | Keywords: | symbolObj, symbolSet, msAppendSymbol, msGrowSymbolSet |
Cc: | dmorissette, aboudreault |
Description
msAppendSymbol()
should append a symbolObj to a symbolSetObj.
The function calls msGrowSymbolSet()
, which already allocates memory for a symbolObj instance at symbolset->symbol[symbolset->numsymbols-1]
.
But msAppendSymbol
immediately overwrites this pointer with the pointer to the inserted symbolObj.
So the memory allocated to symbolset->symbol[symbolset->numsymbols-1]
by msGrowSymbolSet()
will never be freed.
Possible solutions:
- free the memory allocated by
msGrowSymbolSet()
before inserting the new symbolObj. - copy by value
- do not use
msAppendSymbol
(unfortunately mapscript uses it..)
Change History (2)
comment:1 by , 13 years ago
Cc: | added |
---|---|
Milestone: | FUTURE → 6.0.2 release |
comment:2 by , 13 years ago
Cc: | added |
---|
Note:
See TracTickets
for help on using tickets.