Opened 16 years ago

Closed 15 years ago

#2584 closed defect (fixed)

Memory leak in msOracleSpatialLayerGetShape()

Reported by: jimk Owned by: fsimon@…
Priority: normal Milestone: 6.0 release
Component: Input - Native Oracle Spatial Support Version: 5.0
Severity: normal Keywords:
Cc: sdlime, dmorissette

Description

I found a memory leak in maporaclespatial.c in msOracleSpatialLayerGetShape that was preventing me from retrieving large datasets via WFS from an Oracle Spatial source.

layerinfo->items_query = (item_text_array_query *)malloc( sizeof(item_text_array_query) * (layer->numitems) );

(Line 2052 in v5.0.2)

This is allocated every time the function is called and is never freed.

I put this:

if(layerinfo->items_query) free(layerinfo->items_query); JSK 2008-04-16 try to clean up memory leak in big datasets

one line previous to it to fix it, but looking at the code it may be sufficient to just check if items_query is null and only execute the malloc if items_query is null.

Attachments (1)

maporaclespatial-memleak.patch (520 bytes ) - added by jimk 15 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by jimk, 15 years ago

Also see #2927

by jimk, 15 years ago

comment:2 by dmorissette, 15 years ago

Cc: dmorissette added
Milestone: 6.0 release
Resolution: fixed
Status: newclosed

Fixed in SVN trunk (6.0) r8715.

Note: See TracTickets for help on using tickets.