Ticket #3643 (new defect)
Temporary file for SLD external graphic is not deleted
|Reported by:||matthijsln||Owned by:||mapserverbugs|
|Component:||WMS Server||Version:||svn-trunk (development)|
|Severity:||minor||Keywords:||sld temporary file external graphic|
When using an ExternalGraphic in a SLD symbolizer, a temporary .gif or .png file is created with msTmpFile() in msSLDParseExternalGraphic() in mapogcsld.c. After the external image is saved to the temporary file using msHTTPGetFile(), it is never deleted.
In my case this led to a build-up of thousands of temporary files after many WMS requests.
#1123 is similar but concerning the SLD itself.
The solution would be to add the line
after the call to msSLDGetGraphicSymbol() in the function msSLDParseExternalGraphic() in mapogcsld.c.
Another very minor issue is that the filename allocated by msTmpFile() is not msFree()'d. This also occurs in other places where msTmpFile() is used.
Steps to reproduce:
- save extgraphicsld.map to /tmp/
- save extgraphicsld.xml to /var/www/
- open the following url:
- observe a temporary gif file in /tmp remaining after each request