Ticket #3573 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Fix memory leaks in mapwfs.c and mapwfs11.c

Reported by: rouault Owned by: assefa
Priority: normal Milestone:
Component: WFS Server Version: unspecified
Severity: normal Keywords:
Cc: assefa

Description

* Fixes 2 leaks in error code path * Fix one leak in normal code path

(detected by valgrind)

Attachments

fix_mapwfs_memleaks.patch Download (1.6 KB) - added by rouault 3 years ago.

Change History

Changed 3 years ago by rouault

Changed 3 years ago by sdlime

  • cc assefa added

Changed 3 years ago by assefa

  • owner changed from sdlime to assefa
  • component changed from MapServer C Library to WFS Server

Changed 3 years ago by assefa

applying patch.. One thing though in -- mapwfs11.c, should we free the name space (+ xmlFreeNs(psNsOws). I believe that will be freed when the document is freed. Is there a leak on that that you have seen? Thanks

Changed 3 years ago by rouault

Yes, the fix in mapwfs11.c fixes a leak reported by valgrind at line 61 (psNsOws = xmlNewNs(NULL, BAD_CAST " http://www.opengis.net/ows", BAD_CAST "ows")). I had a hard time to come to that fix (I am not familiar with using libxml2) as it looks a bit strange, but it makes valgrind happy...

Changed 3 years ago by assefa

  • status changed from new to closed
  • resolution set to fixed

I have applied the patch r10615. It is effectively strange to me regarding valigrind complaining. Re-reading the docs seem to indicate and children elements should be freed. Thanks.

Note: See TracTickets for help on using tickets.