[mapserver-dev] Checks in msFreeCharArray

martin.kofahl at gmail.com martin.kofahl at gmail.com
Wed Apr 8 12:52:03 PDT 2015

Sorry, my fault. The check is already done in branch-7-0. I was accidently working on a 6-5 branch.


Von: Daniel Morissette
Gesendet: Mittwoch, 8. April 2015 16:34
An: mapserver-dev at lists.osgeo.org
Betreff: Re: [mapserver-dev] Checks in msFreeCharArray

On 2015-04-08 10:19 AM, martin.kofahl at gmail.com wrote:
> Hello,
> I tamper with some cases, where ‎msFreeCharArray is called, but the array was already freed, although num_items is still >0. (The join code.) I would prefer msFreeCharArray checks if array still exisist and sets it to null instead of doing this in the caller functions.
> Would this be ok?

Doing this would require changing the signature of the function to pass 
it a ref to the char array pointer (so that it can be set to NULL), 
which would not feel very natural as most free methods everywhere else 
always receive the pointer value, not a ref to it, and it is always up 
to the caller to properly managing the pointer (setting to NULL or other 

I'm open to hearing more arguments in favor of this approach, but at 
this point I'd be -0 on this change.

Daniel Morissette
T: +1 418-696-5056 #201
Provider of Professional MapServer Support since 2000
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org

More information about the mapserver-dev mailing list