Skip to content
Permalink
Browse files
Fix memory leaks on shape->values
  • Loading branch information
jbo-ads committed Feb 25, 2020
1 parent 857a138 commit bf8458a177221c8e2bb2a10a5e66ac267a397a34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
@@ -2823,6 +2823,7 @@ msOGRFileNextShape(layerObj *layer, shapeObj *shape,
psInfo->last_record_index_read++;

if(layer->numitems > 0) {
if (shape->values) msFreeCharArray(shape->values, shape->numvalues);
shape->values = msOGRGetValues(layer, hFeature);
shape->numvalues = layer->numitems;
if(!shape->values) {
@@ -131,6 +131,7 @@ int msCopyShape(shapeObj *from, shapeObj *to)
to->resultindex = from->resultindex;

if(from->values) {
if (to->values) msFreeCharArray(to->values, to->numvalues);
to->values = (char **)msSmallMalloc(sizeof(char *)*from->numvalues);
for(i=0; i<from->numvalues; i++)
to->values[i] = msStrdup(from->values[i]);

0 comments on commit bf8458a

Please sign in to comment.