crypto/x509v3/v3_conf.c:168: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 147, column 24 is not reachable after line 168, column 5.
Showing all 78 steps of the trace


crypto/x509v3/v3_conf.c:129:1: start of procedure do_ext_i2d()
127.   }
128.   
129. > static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method,
130.                                     int ext_nid, int crit, void *ext_struc)
131.   {

crypto/x509v3/v3_conf.c:132:5: 
130.                                     int ext_nid, int crit, void *ext_struc)
131.   {
132. >     unsigned char *ext_der = NULL;
133.       int ext_len;
134.       ASN1_OCTET_STRING *ext_oct = NULL;

crypto/x509v3/v3_conf.c:134:5: 
132.       unsigned char *ext_der = NULL;
133.       int ext_len;
134. >     ASN1_OCTET_STRING *ext_oct = NULL;
135.       X509_EXTENSION *ext;
136.       /* Convert internal representation to DER */

crypto/x509v3/v3_conf.c:137:9: Taking false branch
135.       X509_EXTENSION *ext;
136.       /* Convert internal representation to DER */
137.       if (method->it) {
               ^
138.           ext_der = NULL;
139.           ext_len =

crypto/x509v3/v3_conf.c:146:9: Skipping __function_pointer__(): unresolved function pointer
144.           unsigned char *p;
145.   
146.           ext_len = method->i2d(ext_struc, NULL);
               ^
147.           if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
148.               goto merr;

crypto/x509v3/v3_conf.c:147:13: 
145.   
146.           ext_len = method->i2d(ext_struc, NULL);
147. >         if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
148.               goto merr;
149.           p = ext_der;

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
  69.   }
  70.   
  71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73.       void *ret = NULL;

crypto/mem.c:73:5: 
  71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73. >     void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:78:9: Taking false branch
  76.           return malloc_impl(num, file, line);
  77.   
  78.       if (num <= 0)
                ^
  79.           return NULL;
  80.   

crypto/mem.c:81:5: 
  79.           return NULL;
  80.   
  81. >     allow_customize = 0;
  82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:91:24: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:92:5: 
  90.   #else
  91.       osslargused(file); osslargused(line);
  92. >     ret = malloc(num);
  93.   #endif
  94.   

crypto/mem.c:95:5: 
  93.   #endif
  94.   
  95. >     return ret;
  96.   }
  97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
  94.   
  95.       return ret;
  96. > }
  97.   
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/x509v3/v3_conf.c:147:13: Taking false branch
145.   
146.           ext_len = method->i2d(ext_struc, NULL);
147.           if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
                   ^
148.               goto merr;
149.           p = ext_der;

crypto/x509v3/v3_conf.c:149:9: 
147.           if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
148.               goto merr;
149. >         p = ext_der;
150.           method->i2d(ext_struc, &p);
151.       }

crypto/x509v3/v3_conf.c:150:9: Skipping __function_pointer__(): unresolved function pointer
148.               goto merr;
149.           p = ext_der;
150.           method->i2d(ext_struc, &p);
               ^
151.       }
152.       if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)

crypto/x509v3/v3_conf.c:152:9: 
150.           method->i2d(ext_struc, &p);
151.       }
152. >     if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
153.           goto merr;
154.       ext_oct->data = ext_der;

crypto/asn1/tasn_typ.c:28:1: start of procedure ASN1_OCTET_STRING_new()
  26.   }
  27.   
  28. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  29.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  30.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

crypto/asn1/tasn_typ.c:28:1: return from a call to ASN1_OCTET_STRING_new
  26.   }
  27.   
  28. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  29.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  30.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

crypto/x509v3/v3_conf.c:152:9: Taking false branch
150.           method->i2d(ext_struc, &p);
151.       }
152.       if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
               ^
153.           goto merr;
154.       ext_oct->data = ext_der;

crypto/x509v3/v3_conf.c:154:5: 
152.       if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
153.           goto merr;
154. >     ext_oct->data = ext_der;
155.       ext_der = NULL;
156.       ext_oct->length = ext_len;

crypto/x509v3/v3_conf.c:155:5: 
153.           goto merr;
154.       ext_oct->data = ext_der;
155. >     ext_der = NULL;
156.       ext_oct->length = ext_len;
157.   

crypto/x509v3/v3_conf.c:156:5: 
154.       ext_oct->data = ext_der;
155.       ext_der = NULL;
156. >     ext_oct->length = ext_len;
157.   
158.       ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);

crypto/x509v3/v3_conf.c:158:5: 
156.       ext_oct->length = ext_len;
157.   
158. >     ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
159.       if (!ext)
160.           goto merr;

crypto/x509/x509_v3.c:135:1: start of procedure X509_EXTENSION_create_by_NID()
  133.   }
  134.   
  135. > X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
  136.                                                int crit,
  137.                                                ASN1_OCTET_STRING *data)

crypto/x509/x509_v3.c:142:5: 
  140.       X509_EXTENSION *ret;
  141.   
  142. >     obj = OBJ_nid2obj(nid);
  143.       if (obj == NULL) {
  144.           X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:220:1: start of procedure OBJ_nid2obj()
    218.   }
    219.   
    220. > ASN1_OBJECT *OBJ_nid2obj(int n)
    221.   {
    222.       ADDED_OBJ ad, *adp;

crypto/objects/obj_dat.c:225:10: Taking true branch
    223.       ASN1_OBJECT ob;
    224.   
    225.       if ((n >= 0) && (n < NUM_NID)) {
                    ^
    226.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
    227.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:225:22: Taking false branch
    223.       ASN1_OBJECT ob;
    224.   
    225.       if ((n >= 0) && (n < NUM_NID)) {
                                ^
    226.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
    227.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:231:16: Taking false branch
    229.           }
    230.           return ((ASN1_OBJECT *)&(nid_objs[n]));
    231.       } else if (added == NULL)
                          ^
    232.           return (NULL);
    233.       else {

crypto/objects/obj_dat.c:234:9: 
    232.           return (NULL);
    233.       else {
    234. >         ad.type = ADDED_NID;
    235.           ad.obj = &ob;
    236.           ob.nid = n;

crypto/objects/obj_dat.c:235:9: 
    233.       else {
    234.           ad.type = ADDED_NID;
    235. >         ad.obj = &ob;
    236.           ob.nid = n;
    237.           adp = lh_ADDED_OBJ_retrieve(added, &ad);

crypto/objects/obj_dat.c:236:9: 
    234.           ad.type = ADDED_NID;
    235.           ad.obj = &ob;
    236. >         ob.nid = n;
    237.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
    238.           if (adp != NULL)

crypto/objects/obj_dat.c:237:9: 
    235.           ad.obj = &ob;
    236.           ob.nid = n;
    237. >         adp = lh_ADDED_OBJ_retrieve(added, &ad);
    238.           if (adp != NULL)
    239.               return (adp->obj);

crypto/objects/obj_lcl.h:14:1: start of procedure lh_ADDED_OBJ_retrieve()
      12.   DEFINE_LHASH_OF(OBJ_NAME);
      13.   typedef struct added_obj_st ADDED_OBJ;
      14. > DEFINE_LHASH_OF(ADDED_OBJ);

crypto/lhash/lhash.c:131:1: start of procedure OPENSSL_LH_retrieve()
        129.   }
        130.   
        131. > void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)
        132.   {
        133.       unsigned long hash;

crypto/lhash/lhash.c:137:5: 
        135.       void *ret;
        136.   
        137. >     lh->error = 0;
        138.       rn = getrn(lh, data, &hash);
        139.   

crypto/lhash/lhash.c:138:5: Skipping getrn(): empty list of specs
        136.   
        137.       lh->error = 0;
        138.       rn = getrn(lh, data, &hash);
                   ^
        139.   
        140.       if (*rn == NULL) {

crypto/lhash/lhash.c:140:9: Taking true branch
        138.       rn = getrn(lh, data, &hash);
        139.   
        140.       if (*rn == NULL) {
                       ^
        141.           lh->num_retrieve_miss++;
        142.           return (NULL);

crypto/lhash/lhash.c:141:9: 
        139.   
        140.       if (*rn == NULL) {
        141. >         lh->num_retrieve_miss++;
        142.           return (NULL);
        143.       } else {

crypto/lhash/lhash.c:142:9: 
        140.       if (*rn == NULL) {
        141.           lh->num_retrieve_miss++;
        142. >         return (NULL);
        143.       } else {
        144.           ret = (*rn)->data;

crypto/lhash/lhash.c:148:1: return from a call to OPENSSL_LH_retrieve
        146.       }
        147.       return (ret);
        148. > }
        149.   
        150.   static void doall_util_fn(OPENSSL_LHASH *lh, int use_arg,

crypto/objects/obj_lcl.h:14:1: return from a call to lh_ADDED_OBJ_retrieve
      12.   DEFINE_LHASH_OF(OBJ_NAME);
      13.   typedef struct added_obj_st ADDED_OBJ;
      14. > DEFINE_LHASH_OF(ADDED_OBJ);

crypto/objects/obj_dat.c:238:13: Taking false branch
    236.           ob.nid = n;
    237.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
    238.           if (adp != NULL)
                       ^
    239.               return (adp->obj);
    240.           else {

crypto/objects/obj_dat.c:241:13: Skipping ERR_put_error(): empty list of specs
    239.               return (adp->obj);
    240.           else {
    241.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
                       ^
    242.               return (NULL);
    243.           }

crypto/objects/obj_dat.c:242:13: 
    240.           else {
    241.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);
    242. >             return (NULL);
    243.           }
    244.       }

crypto/objects/obj_dat.c:245:1: return from a call to OBJ_nid2obj
    243.           }
    244.       }
    245. > }
    246.   
    247.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:143:9: Taking true branch
  141.   
  142.       obj = OBJ_nid2obj(nid);
  143.       if (obj == NULL) {
                 ^
  144.           X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);
  145.           return (NULL);

crypto/x509/x509_v3.c:144:9: Skipping ERR_put_error(): empty list of specs
  142.       obj = OBJ_nid2obj(nid);
  143.       if (obj == NULL) {
  144.           X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);
                 ^
  145.           return (NULL);
  146.       }

crypto/x509/x509_v3.c:145:9: 
  143.       if (obj == NULL) {
  144.           X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);
  145. >         return (NULL);
  146.       }
  147.       ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);

crypto/x509/x509_v3.c:151:1: return from a call to X509_EXTENSION_create_by_NID
  149.           ASN1_OBJECT_free(obj);
  150.       return (ret);
  151. > }
  152.   
  153.   X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,

crypto/x509v3/v3_conf.c:159:10: Taking true branch
157.   
158.       ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
159.       if (!ext)
                ^
160.           goto merr;
161.       ASN1_OCTET_STRING_free(ext_oct);

crypto/x509v3/v3_conf.c:165:2: 
163.       return ext;
164.   
165. >  merr:
166.       X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
167.       OPENSSL_free(ext_der);

crypto/x509v3/v3_conf.c:166:5: Skipping ERR_put_error(): empty list of specs
164.   
165.    merr:
166.       X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
           ^
167.       OPENSSL_free(ext_der);
168.       ASN1_OCTET_STRING_free(ext_oct);

crypto/x509v3/v3_conf.c:167:5: 
165.    merr:
166.       X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
167. >     OPENSSL_free(ext_der);
168.       ASN1_OCTET_STRING_free(ext_oct);
169.       return NULL;

crypto/mem.c:163:1: start of procedure CRYPTO_free()
  161.   }
  162.   
  163. > void CRYPTO_free(void *str, const char *file, int line)
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking true branch
  163.   void CRYPTO_free(void *str, const char *file, int line)
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                 ^
  166.           free_impl(str, file, line);
  167.           return;

crypto/mem.c:165:30: Taking true branch
  163.   void CRYPTO_free(void *str, const char *file, int line)
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                      ^
  166.           free_impl(str, file, line);
  167.           return;

crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
  164.   {
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  166.           free_impl(str, file, line);
                 ^
  167.           return;
  168.       }

crypto/mem.c:167:9: 
  165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
  166.           free_impl(str, file, line);
  167. >         return;
  168.       }
  169.   

crypto/mem.c:181:1: return from a call to CRYPTO_free
  179.       free(str);
  180.   #endif
  181. > }
  182.   
  183.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509v3/v3_conf.c:168:5: 
166.       X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
167.       OPENSSL_free(ext_der);
168. >     ASN1_OCTET_STRING_free(ext_oct);
169.       return NULL;
170.   

crypto/asn1/tasn_typ.c:28:1: start of procedure ASN1_OCTET_STRING_free()
  26.   }
  27.   
  28. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  29.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  30.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

crypto/asn1/asn1_lib.c:313:1: start of procedure ASN1_STRING_free()
    311.   }
    312.   
    313. > void ASN1_STRING_free(ASN1_STRING *a)
    314.   {
    315.       if (a == NULL)

crypto/asn1/asn1_lib.c:315:9: Taking false branch
    313.   void ASN1_STRING_free(ASN1_STRING *a)
    314.   {
    315.       if (a == NULL)
                   ^
    316.           return;
    317.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))

crypto/asn1/asn1_lib.c:317:11: Taking false branch
    315.       if (a == NULL)
    316.           return;
    317.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
                     ^
    318.           OPENSSL_free(a->data);
    319.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))

crypto/asn1/asn1_lib.c:319:11: Taking true branch
    317.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    318.           OPENSSL_free(a->data);
    319.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
                     ^
    320.           OPENSSL_free(a);
    321.   }

crypto/asn1/asn1_lib.c:320:9: 
    318.           OPENSSL_free(a->data);
    319.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    320. >         OPENSSL_free(a);
    321.   }
    322.   

crypto/mem.c:163:1: start of procedure CRYPTO_free()
      161.   }
      162.   
      163. > void CRYPTO_free(void *str, const char *file, int line)
      164.   {
      165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking false branch
      163.   void CRYPTO_free(void *str, const char *file, int line)
      164.   {
      165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                     ^
      166.           free_impl(str, file, line);
      167.           return;

crypto/mem.c:179:5: 
      177.       }
      178.   #else
      179. >     free(str);
      180.   #endif
      181.   }

crypto/mem.c:181:1: return from a call to CRYPTO_free
      179.       free(str);
      180.   #endif
      181. > }
      182.   
      183.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/asn1/asn1_lib.c:319:5: 
    317.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    318.           OPENSSL_free(a->data);
    319. >     if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    320.           OPENSSL_free(a);
    321.   }

crypto/asn1/asn1_lib.c:321:1: return from a call to ASN1_STRING_free
    319.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    320.           OPENSSL_free(a);
    321. > }
    322.   
    323.   void ASN1_STRING_clear_free(ASN1_STRING *a)

crypto/asn1/tasn_typ.c:28:1: return from a call to ASN1_OCTET_STRING_free
  26.   }
  27.   
  28. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  29.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  30.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method,
                                  int ext_nid, int crit, void *ext_struc)
{
    unsigned char *ext_der = NULL;
    int ext_len;
    ASN1_OCTET_STRING *ext_oct = NULL;
    X509_EXTENSION *ext;
    if (method->it) {
        ext_der = NULL;
        ext_len =
            ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it));
        if (ext_len < 0)
            goto merr;
    } else {
        unsigned char *p;
        ext_len = method->i2d(ext_struc, NULL);
        if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
            goto merr;
        p = ext_der;
        method->i2d(ext_struc, &p);
    }
    if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
        goto merr;
    ext_oct->data = ext_der;
    ext_der = NULL;
    ext_oct->length = ext_len;
    ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
    if (!ext)
        goto merr;
    ASN1_OCTET_STRING_free(ext_oct);
    return ext;
 merr:
    X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
    OPENSSL_free(ext_der);
    ASN1_OCTET_STRING_free(ext_oct);
    return NULL;
}
['static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method,\n                                  int ext_nid, int crit, void *ext_struc)\n{\n    unsigned char *ext_der = NULL;\n    int ext_len;\n    ASN1_OCTET_STRING *ext_oct = NULL;\n    X509_EXTENSION *ext;\n    if (method->it) {\n        ext_der = NULL;\n        ext_len =\n            ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it));\n        if (ext_len < 0)\n            goto merr;\n    } else {\n        unsigned char *p;\n        ext_len = method->i2d(ext_struc, NULL);\n        if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)\n            goto merr;\n        p = ext_der;\n        method->i2d(ext_struc, &p);\n    }\n    if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)\n        goto merr;\n    ext_oct->data = ext_der;\n    ext_der = NULL;\n    ext_oct->length = ext_len;\n    ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);\n    if (!ext)\n        goto merr;\n    ASN1_OCTET_STRING_free(ext_oct);\n    return ext;\n merr:\n    X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);\n    OPENSSL_free(ext_der);\n    ASN1_OCTET_STRING_free(ext_oct);\n    return NULL;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)', 'X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,\n                                             int crit,\n                                             ASN1_OCTET_STRING *data)\n{\n    ASN1_OBJECT *obj;\n    X509_EXTENSION *ret;\n    obj = OBJ_nid2obj(nid);\n    if (obj == NULL) {\n        X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);\n        return (NULL);\n    }\n    ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);\n    if (ret == NULL)\n        ASN1_OBJECT_free(obj);\n    return (ret);\n}', 'ASN1_OBJECT *OBJ_nid2obj(int n)\n{\n    ADDED_OBJ ad, *adp;\n    ASN1_OBJECT ob;\n    if ((n >= 0) && (n < NUM_NID)) {\n        if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {\n            OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);\n            return (NULL);\n        }\n        return ((ASN1_OBJECT *)&(nid_objs[n]));\n    } else if (added == NULL)\n        return (NULL);\n    else {\n        ad.type = ADDED_NID;\n        ad.obj = &ob;\n        ob.nid = n;\n        adp = lh_ADDED_OBJ_retrieve(added, &ad);\n        if (adp != NULL)\n            return (adp->obj);\n        else {\n            OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);\n            return (NULL);\n        }\n    }\n}', 'DEFINE_LHASH_OF(ADDED_OBJ)', 'void *OPENSSL_LH_retrieve(OPENSSL_LHASH *lh, const void *data)\n{\n    unsigned long hash;\n    OPENSSL_LH_NODE **rn;\n    void *ret;\n    lh->error = 0;\n    rn = getrn(lh, data, &hash);\n    if (*rn == NULL) {\n        lh->num_retrieve_miss++;\n        return (NULL);\n    } else {\n        ret = (*rn)->data;\n        lh->num_retrieve++;\n    }\n    return (ret);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}', 'void ASN1_STRING_free(ASN1_STRING *a)\n{\n    if (a == NULL)\n        return;\n    if (!(a->flags & ASN1_STRING_FLAG_NDEF))\n        OPENSSL_free(a->data);\n    if (!(a->flags & ASN1_STRING_FLAG_EMBED))\n        OPENSSL_free(a);\n}']