Navigation Menu

Skip to content

Commit

Permalink
loadLayer(): fix memory leak in error code path
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and github-actions[bot] committed Oct 31, 2022
1 parent ccc89d7 commit 8a6f067
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mapfile.c
Expand Up @@ -4322,7 +4322,10 @@ int loadLayer(layerObj *layer, mapObj *map)
return(-1);
}

if(loadJoin(&(layer->joins[layer->numjoins])) == -1) return(-1);
if(loadJoin(&(layer->joins[layer->numjoins])) == -1) {
freeJoin(&(layer->joins[layer->numjoins]));
return(-1);
}
layer->numjoins++;
break;
case(LABELCACHE):
Expand Down

0 comments on commit 8a6f067

Please sign in to comment.