src/map_asn1.c
changeset 647 e4cfa409ceef
parent 645 0bb373719dce
child 648 1f83d8ad4f55
     1.1 --- a/src/map_asn1.c	Tue May 17 20:59:37 2016 +0200
     1.2 +++ b/src/map_asn1.c	Tue May 17 21:18:45 2016 +0200
     1.3 @@ -126,15 +126,14 @@
     1.4          return NULL;
     1.5  
     1.6      for (const stringlist_t *l = list; l && l->value; l=l->next) {
     1.7 -        Hash_t key;
     1.8 -        memset(&key, 0, sizeof(Hash_t));
     1.9 -        if (OCTET_STRING_fromBuf(&key, l->value, -1))
    1.10 +        Hash_t *key = OCTET_STRING_new_fromBuf(&asn_DEF_Hash, l->value, -1);
    1.11 +        if (!key)
    1.12              goto enomem;
    1.13  
    1.14 -        int r = ASN_SEQUENCE_ADD(&result->list, &key);
    1.15 -        ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_Hash, &key);
    1.16 -        if (r)
    1.17 +        if (ASN_SEQUENCE_ADD(&result->list, key)) {
    1.18 +            ASN_STRUCT_FREE(asn_DEF_Hash, key);
    1.19              goto enomem;
    1.20 +        }
    1.21      }
    1.22  
    1.23      return result;