diff --git a/README.md b/README.md index 99c3c84044ed..4d458ac82db1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ GDAL - Geospatial Data Abstraction Library [![Build Status](https://github.com/OSGeo/gdal/actions/workflows/clang_static_analyzer.yml/badge.svg)](https://github.com/osgeo/gdal/actions?query=workflow%3A%22CLang+Static+Analyzer%22+branch%3Amaster) [![Build Status](https://github.com/OSGeo/gdal/actions/workflows/code_checks.yml/badge.svg)](https://github.com/osgeo/gdal/actions?query=workflow%3A%22Code+Checks%22+branch%3Amaster) [![Build Status](https://github.com/OSGeo/gdal/actions/workflows/conda.yml/badge.svg)](https://github.com/osgeo/gdal/actions?query=workflow%3A%22Conda%22+branch%3Amaster) -[![Build Status](https://travis-ci.com/OSGeo/gdal.svg?branch=master)](https://travis-ci.com/OSGeo/gdal) +[![Build Status](https://app.travis-ci.com/OSGeo/gdal.svg?branch=master)](https://app.travis-ci.com/OSGeo/gdal) [![Build Status](https://scan.coverity.com/projects/749/badge.svg?flat=1)](https://scan.coverity.com/projects/gdal) [![Documentation build Status](https://github.com/OSGeo/gdal/workflows/Docs/badge.svg)](https://github.com/osgeo/gdal/actions?query=workflow%3A%22Docs%22+branch%3Amaster) [![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/gdal.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:gdal) diff --git a/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c b/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c index 15c9c1facbcb..330de60aca21 100644 --- a/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c +++ b/ogr/ogrsf_frmts/miramon/mm_gdal_functions.c @@ -1695,13 +1695,17 @@ int MM_ReadExtendedDBFHeaderFromFile(const char *szFileName, return 0; } // End of MM_ReadExtendedDBFHeaderFromFile() -void MM_ReleaseDBFHeader(struct MM_DATA_BASE_XP *data_base_XP) +void MM_ReleaseDBFHeader(struct MM_DATA_BASE_XP **data_base_XP) { - if (data_base_XP) - { - MM_ReleaseMainFields(data_base_XP); - free_function(data_base_XP); - } + if (!data_base_XP) + return; + if (!*data_base_XP) + return; + + MM_ReleaseMainFields(*data_base_XP); + free_function(*data_base_XP); + *data_base_XP = nullptr; + return; } diff --git a/ogr/ogrsf_frmts/miramon/mm_gdal_functions.h b/ogr/ogrsf_frmts/miramon/mm_gdal_functions.h index eb4464f4d625..351470946d24 100644 --- a/ogr/ogrsf_frmts/miramon/mm_gdal_functions.h +++ b/ogr/ogrsf_frmts/miramon/mm_gdal_functions.h @@ -102,7 +102,7 @@ MM_GiveOffsetExtendedFieldName(const struct MM_FIELD *camp); struct MM_DATA_BASE_XP *MM_CreateDBFHeader(MM_EXT_DBF_N_FIELDS n_camps, MM_BYTE nCharSet); void MM_ReleaseMainFields(struct MM_DATA_BASE_XP *data_base_XP); -void MM_ReleaseDBFHeader(struct MM_DATA_BASE_XP *data_base_XP); +void MM_ReleaseDBFHeader(struct MM_DATA_BASE_XP **data_base_XP); MM_BOOLEAN MM_CreateAndOpenDBFFile(struct MM_DATA_BASE_XP *bd_xp, const char *NomFitxer); int MM_DuplicateFieldDBXP(struct MM_FIELD *camp_final, diff --git a/ogr/ogrsf_frmts/miramon/mm_wrlayr.c b/ogr/ogrsf_frmts/miramon/mm_wrlayr.c index ccdf8724dae9..c0d30b761513 100644 --- a/ogr/ogrsf_frmts/miramon/mm_wrlayr.c +++ b/ogr/ogrsf_frmts/miramon/mm_wrlayr.c @@ -7397,8 +7397,8 @@ static void MMDestroyMMDBFile(struct MiraMonVectLayerInfo *hMiraMonLayer, if (pMMAdmDB && pMMAdmDB->pMMBDXP) { - MM_ReleaseDBFHeader(pMMAdmDB->pMMBDXP); - hMiraMonLayer->pMMBDXP = pMMAdmDB->pMMBDXP = nullptr; + MM_ReleaseDBFHeader(&pMMAdmDB->pMMBDXP); + hMiraMonLayer->pMMBDXP = nullptr; } if (pMMAdmDB && pMMAdmDB->pRecList) {