Skip to content

Commit 8a6f067

Browse files
rouaultgithub-actions[bot]
authored andcommitted
loadLayer(): fix memory leak in error code path
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52702
1 parent ccc89d7 commit 8a6f067

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: mapfile.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -4322,7 +4322,10 @@ int loadLayer(layerObj *layer, mapObj *map)
43224322
return(-1);
43234323
}
43244324

4325-
if(loadJoin(&(layer->joins[layer->numjoins])) == -1) return(-1);
4325+
if(loadJoin(&(layer->joins[layer->numjoins])) == -1) {
4326+
freeJoin(&(layer->joins[layer->numjoins]));
4327+
return(-1);
4328+
}
43264329
layer->numjoins++;
43274330
break;
43284331
case(LABELCACHE):

0 commit comments

Comments
 (0)