Opened 14 years ago

Closed 14 years ago

#3573 closed defect (fixed)

[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 (1)

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

Download all attachments as: .zip

Change History (6)

by rouault, 14 years ago

Attachment: fix_mapwfs_memleaks.patch added

comment:1 by sdlime, 14 years ago

Cc: assefa added

comment:2 by assefa, 14 years ago

Component: MapServer C LibraryWFS Server
Owner: changed from sdlime to assefa

comment:3 by assefa, 14 years ago

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

comment:4 by rouault, 14 years ago

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...

comment:5 by assefa, 14 years ago

Resolution: fixed
Status: newclosed

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.