Skip to content

Commit

Permalink
msQueryByFeatures(): avoid potential segfault when reslut set is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jun 9, 2021
1 parent e2ef155 commit 98ad83a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mapquery.c
Expand Up @@ -1617,7 +1617,7 @@ int msQueryByFeatures(mapObj *map)

} /* next selection shape */

if(lp->resultcache->numresults == 0) msLayerClose(lp); /* no need to keep the layer open */
if(lp->resultcache == NULL || lp->resultcache->numresults == 0) msLayerClose(lp); /* no need to keep the layer open */
} /* next layer */

/* was anything found? */
Expand Down

0 comments on commit 98ad83a

Please sign in to comment.