ECC-982 and ECC-765: BUFR leak

This commit is contained in:
Shahram Najm 2019-09-02 16:41:41 +01:00
parent 721ef5977e
commit a0afde267c
1 changed files with 3 additions and 1 deletions

View File

@ -2456,9 +2456,11 @@ static int create_keys(grib_accessor* a,long onlySubset,long startSubset,long en
associatedFieldAccessor=NULL;
if (elementFromBitmap && self->unpackMode==CODES_BUFR_UNPACK_STRUCTURE) {
if (descriptor->code != 33007 && descriptor->code != 223255 ) {
char* aname = grib_context_strdup(c,elementFromBitmap->name);
grib_accessor* newAccessor=grib_accessor_clone(elementAccessor,section,&err);
newAccessor->parent=groupSection;
newAccessor->name=grib_context_strdup(c,elementFromBitmap->name);
newAccessor->name=aname;
grib_sarray_push(a->context, self->tempStrings, aname);
grib_push_accessor(newAccessor,groupSection->block);
rank=grib_data_accessors_trie_push(self->dataAccessorsTrie,newAccessor);
grib_accessors_list_push(self->dataAccessors,newAccessor,rank);