Opened 15 years ago

Closed 15 years ago

#2857 closed defect (fixed)

Memory leaks of loadExpression() and loadLabel() methods

Reported by: aboudreault Owned by: aboudreault
Priority: normal Milestone: 5.2.2 release
Component: MapServer C Library Version: 5.2
Severity: normal Keywords:
Cc: dmorissette, sdlime

Description

These methods have some small memory leaks when we use "msUpdate*FromString" methods. The string data are not freed before reallocation.

Attachments (1)

bug2857.patch (4.9 KB ) - added by aboudreault 15 years ago.

Download all attachments as: .zip

Change History (5)

by aboudreault, 15 years ago

Attachment: bug2857.patch added

comment:1 by aboudreault, 15 years ago

I've added some verifications to ensure that the string variables are NULL before replace it. The following methods had some memory leaks when their appropriate "update*FromString()" methods was used:

  • loadLabel()
  • loadStyle()
  • loadClass()
  • loadReferenceMap()

in reply to:  1 comment:2 by aboudreault, 15 years ago

Replying to aboudreault:

I've added some verifications to ensure that the string variables are NULL before replace it. The following methods had some memory leaks when their appropriate "update*FromString()" methods was used:

  • loadLabel()
  • loadStyle()
  • loadClass()
  • loadReferenceMap()

and

  • loadExpression()

comment:3 by dmorissette, 15 years ago

Cc: sdlime added

Alan, the patch looks good. Please commit to trunk and also backport to the 5.2 branch.

comment:4 by aboudreault, 15 years ago

Resolution: fixed
Status: newclosed

Committed in SVN trunk (r8520) and backported in 5.2 branch (r8522).

Note: See TracTickets for help on using tickets.