diff --git a/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c b/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c index 0cd274b75bce..4c84c75acba8 100644 --- a/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c +++ b/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c @@ -622,7 +622,10 @@ static char *MM_SetSubIndexFieldNam(const char *nom_camp, _subindex = MM_GiveNewStringWithCharacterInFront(subindex, '_'); if (!_subindex) + { + free_function(NomCamp_SubIndex); return nullptr; + } sizet_subindex = strlen(_subindex); sizet_nomcamp = strlen(NomCamp_SubIndex);