Skip to content

Commit faa697b

Browse files
rouaultgithub-actions[bot]
authored andcommitted
loadGrid(): fix memleak on LABELFORMAT DD
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52670
1 parent 1abcf33 commit faa697b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mapfile.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,10 @@ static int loadGrid( layerObj *pLayer )
10831083
break; /* for string loads */
10841084
case( LABELFORMAT ):
10851085
if(getString(&(pLayer->grid->labelformat)) == MS_FAILURE) {
1086-
if(strcasecmp(msyystring_buffer, "DD") == 0) /* DD triggers a symbol to be returned instead of a string so check for this special case */
1086+
if(strcasecmp(msyystring_buffer, "DD") == 0) /* DD triggers a symbol to be returned instead of a string so check for this special case */ {
1087+
msFree(pLayer->grid->labelformat);
10871088
pLayer->grid->labelformat = msStrdup("DD");
1089+
}
10881090
else
10891091
return(-1);
10901092
}

0 commit comments

Comments
 (0)