Skip to content

Commit

Permalink
maptree: fix memory leaks in error code paths (CID 1503570)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and github-actions[bot] committed Jul 4, 2022
1 parent 5e45af9 commit b849c11
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions maptree.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ static void searchDiskTreeNode(SHPTreeHandle disktree, rectObj aoi, ms_bitarray
msSetBit(status, ids[i], 1);
}
free(ids);
ids = NULL;
}

if( fread( &numsubnodes, 4, 1, disktree->fp ) != 1 )
Expand All @@ -531,6 +532,7 @@ static void searchDiskTreeNode(SHPTreeHandle disktree, rectObj aoi, ms_bitarray

error:
msSetError(MS_IOERR, NULL, "searchDiskTreeNode()");
free(ids);
return;
}

Expand Down

0 comments on commit b849c11

Please sign in to comment.