Merge pull request #258 from ecmwf/bugfix/bufr_memory_leak

ECC-1951: BUFR: A memory leak occurs when pack=1 fails
This commit is contained in:
shahramn 2024-10-23 17:56:23 +01:00 committed by GitHub
commit cc74eff410
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -2845,6 +2845,7 @@ int grib_accessor_bufr_data_array_t::process_elements(int flag, long onlySubset,
}
else {
if (elementsDescriptorsIndex_ == NULL) {
grib_buffer_delete(c, buffer);
return GRIB_ENCODING_ERROR; /* See ECC-359 */
}
elementsDescriptorsIndex = elementsDescriptorsIndex_->v[iss];