Fix memory leak when setting format options from mapfile #5149

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@gogglesguy
Contributor

Before setting any formatoption from mapfile, make sure to free previous formatoptions as allocated by the default formats.

This slightly modifies the behaviour. Previously it would always overwrite the numformatoptions and thus preventing any use of the default format options. Now it preserves the default format options if none are specified. I'm not sure what behaviour is required. It should be easy to change though if needed.

@gogglesguy gogglesguy Fix memory leak when setting format options from mapfile
Before setting any formatoption from mapfile, make sure to free previous formatoptions as allocated by the default formats.
450007b
@tbonfort
Member
tbonfort commented Sep 8, 2015

I think this patch needs to be reworked to use msSetOutputFormatOption calls instead of freeing/recreating the formatoption list from scratch. That will overwrite an existing key and keep the existing ones.

@tbonfort tbonfort added a commit to tbonfort/mapserver that referenced this pull request Feb 24, 2016
@tbonfort tbonfort Fix memory leak when loading FORMATOPTIONS (#5149) 4df5f9f
@tbonfort
Member

closing, see #5255

@tbonfort tbonfort closed this Feb 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment