crypto/x509v3/v3_conf.c:210: error: MEMORY_LEAK
  memory dynamically allocated by call to `ASN1_OCTET_STRING_new()` at line 201, column 20 is not reachable after line 210, column 5.
Showing all 85 steps of the trace


crypto/x509v3/v3_conf.c:178:1: start of procedure do_ext_i2d()
176.   }
177.   
178. > static X509_EXTENSION *do_ext_i2d(const X509V3_EXT_METHOD *method,
179.                                     int ext_nid, int crit, void *ext_struc)
180.   {

crypto/x509v3/v3_conf.c:181:5: 
179.                                     int ext_nid, int crit, void *ext_struc)
180.   {
181. >     unsigned char *ext_der = NULL;
182.       int ext_len;
183.       ASN1_OCTET_STRING *ext_oct = NULL;

crypto/x509v3/v3_conf.c:183:5: 
181.       unsigned char *ext_der = NULL;
182.       int ext_len;
183. >     ASN1_OCTET_STRING *ext_oct = NULL;
184.       X509_EXTENSION *ext;
185.       /* Convert internal representation to DER */

crypto/x509v3/v3_conf.c:186:9: Taking false branch
184.       X509_EXTENSION *ext;
185.       /* Convert internal representation to DER */
186.       if (method->it) {
               ^
187.           ext_der = NULL;
188.           ext_len =

crypto/x509v3/v3_conf.c:195:9: Skipping __function_pointer__(): unresolved function pointer
193.           unsigned char *p;
194.   
195.           ext_len = method->i2d(ext_struc, NULL);
               ^
196.           if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
197.               goto merr;

crypto/x509v3/v3_conf.c:196:13: 
194.   
195.           ext_len = method->i2d(ext_struc, NULL);
196. >         if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
197.               goto merr;
198.           p = ext_der;

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
  118.   }
  119.   
  120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  121.   {
  122.       void *ret = NULL;

crypto/mem.c:122:5: 
  120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  121.   {
  122. >     void *ret = NULL;
  123.   
  124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
  122.       void *ret = NULL;
  123.   
  124.       if (num <= 0)
                 ^
  125.           return NULL;
  126.   

crypto/mem.c:127:5: 
  125.           return NULL;
  126.   
  127. >     allow_customize = 0;
  128.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
  135.       }
  136.   #else
  137. >     (void)file;
  138.       (void)line;
  139.       ret = malloc(num);

crypto/mem.c:138:5: 
  136.   #else
  137.       (void)file;
  138. >     (void)line;
  139.       ret = malloc(num);
  140.   #endif

crypto/mem.c:139:5: 
  137.       (void)file;
  138.       (void)line;
  139. >     ret = malloc(num);
  140.   #endif
  141.   

crypto/mem.c:154:5: 
  152.   #endif
  153.   
  154. >     return ret;
  155.   }
  156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
  153.   
  154.       return ret;
  155. > }
  156.   
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/x509v3/v3_conf.c:196:13: Taking false branch
194.   
195.           ext_len = method->i2d(ext_struc, NULL);
196.           if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
                   ^
197.               goto merr;
198.           p = ext_der;

crypto/x509v3/v3_conf.c:198:9: 
196.           if ((ext_der = OPENSSL_malloc(ext_len)) == NULL)
197.               goto merr;
198. >         p = ext_der;
199.           method->i2d(ext_struc, &p);
200.       }

crypto/x509v3/v3_conf.c:199:9: Skipping __function_pointer__(): unresolved function pointer
197.               goto merr;
198.           p = ext_der;
199.           method->i2d(ext_struc, &p);
               ^
200.       }
201.       if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)

crypto/x509v3/v3_conf.c:201:9: 
199.           method->i2d(ext_struc, &p);
200.       }
201. >     if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
202.           goto merr;
203.       ext_oct->data = ext_der;

crypto/asn1/tasn_typ.c:77:1: start of procedure ASN1_OCTET_STRING_new()
  75.   }
  76.   
  77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  78.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

crypto/asn1/asn1_lib.c:349:1: start of procedure ASN1_STRING_type_new()
    347.   }
    348.   
    349. > ASN1_STRING *ASN1_STRING_type_new(int type)
    350.   {
    351.       ASN1_STRING *ret;

crypto/asn1/asn1_lib.c:353:5: 
    351.       ASN1_STRING *ret;
    352.   
    353. >     ret = OPENSSL_zalloc(sizeof(*ret));
    354.       if (ret == NULL) {
    355.           ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:157:1: start of procedure CRYPTO_zalloc()
      155.   }
      156.   
      157. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      158.   {
      159.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:159:5: 
      157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      158.   {
      159. >     void *ret = CRYPTO_malloc(num, file, line);
      160.   
      161.       if (ret != NULL)

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
        118.   }
        119.   
        120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
        121.   {
        122.       void *ret = NULL;

crypto/mem.c:122:5: 
        120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
        121.   {
        122. >     void *ret = NULL;
        123.   
        124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
        122.       void *ret = NULL;
        123.   
        124.       if (num <= 0)
                       ^
        125.           return NULL;
        126.   

crypto/mem.c:127:5: 
        125.           return NULL;
        126.   
        127. >     allow_customize = 0;
        128.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
        135.       }
        136.   #else
        137. >     (void)file;
        138.       (void)line;
        139.       ret = malloc(num);

crypto/mem.c:138:5: 
        136.   #else
        137.       (void)file;
        138. >     (void)line;
        139.       ret = malloc(num);
        140.   #endif

crypto/mem.c:139:5: 
        137.       (void)file;
        138.       (void)line;
        139. >     ret = malloc(num);
        140.   #endif
        141.   

crypto/mem.c:154:5: 
        152.   #endif
        153.   
        154. >     return ret;
        155.   }
        156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
        153.   
        154.       return ret;
        155. > }
        156.   
        157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
      159.       void *ret = CRYPTO_malloc(num, file, line);
      160.   
      161.       if (ret != NULL)
                     ^
      162.           memset(ret, 0, num);
      163.       return ret;

crypto/mem.c:162:9: 
      160.   
      161.       if (ret != NULL)
      162. >         memset(ret, 0, num);
      163.       return ret;
      164.   }

crypto/mem.c:163:5: 
      161.       if (ret != NULL)
      162.           memset(ret, 0, num);
      163. >     return ret;
      164.   }
      165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
      162.           memset(ret, 0, num);
      163.       return ret;
      164. > }
      165.   
      166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/asn1/asn1_lib.c:354:9: Taking false branch
    352.   
    353.       ret = OPENSSL_zalloc(sizeof(*ret));
    354.       if (ret == NULL) {
                   ^
    355.           ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW, ERR_R_MALLOC_FAILURE);
    356.           return (NULL);

crypto/asn1/asn1_lib.c:358:5: 
    356.           return (NULL);
    357.       }
    358. >     ret->type = type;
    359.       return (ret);
    360.   }

crypto/asn1/asn1_lib.c:359:5: 
    357.       }
    358.       ret->type = type;
    359. >     return (ret);
    360.   }
    361.   

crypto/asn1/asn1_lib.c:360:1: return from a call to ASN1_STRING_type_new
    358.       ret->type = type;
    359.       return (ret);
    360. > }
    361.   
    362.   void ASN1_STRING_free(ASN1_STRING *a)

crypto/asn1/tasn_typ.c:77:1: return from a call to ASN1_OCTET_STRING_new
  75.   }
  76.   
  77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  78.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

crypto/x509v3/v3_conf.c:201:9: Taking false branch
199.           method->i2d(ext_struc, &p);
200.       }
201.       if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
               ^
202.           goto merr;
203.       ext_oct->data = ext_der;

crypto/x509v3/v3_conf.c:203:5: 
201.       if ((ext_oct = ASN1_OCTET_STRING_new()) == NULL)
202.           goto merr;
203. >     ext_oct->data = ext_der;
204.       ext_der = NULL;
205.       ext_oct->length = ext_len;

crypto/x509v3/v3_conf.c:204:5: 
202.           goto merr;
203.       ext_oct->data = ext_der;
204. >     ext_der = NULL;
205.       ext_oct->length = ext_len;
206.   

crypto/x509v3/v3_conf.c:205:5: 
203.       ext_oct->data = ext_der;
204.       ext_der = NULL;
205. >     ext_oct->length = ext_len;
206.   
207.       ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);

crypto/x509v3/v3_conf.c:207:5: 
205.       ext_oct->length = ext_len;
206.   
207. >     ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
208.       if (!ext)
209.           goto merr;

crypto/x509/x509_v3.c:184:1: start of procedure X509_EXTENSION_create_by_NID()
  182.   }
  183.   
  184. > X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
  185.                                                int crit,
  186.                                                ASN1_OCTET_STRING *data)

crypto/x509/x509_v3.c:191:5: 
  189.       X509_EXTENSION *ret;
  190.   
  191. >     obj = OBJ_nid2obj(nid);
  192.       if (obj == NULL) {
  193.           X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:293:1: start of procedure OBJ_nid2obj()
    291.   }
    292.   
    293. > ASN1_OBJECT *OBJ_nid2obj(int n)
    294.   {
    295.       ADDED_OBJ ad, *adp;

crypto/objects/obj_dat.c:298:10: Taking true branch
    296.       ASN1_OBJECT ob;
    297.   
    298.       if ((n >= 0) && (n < NUM_NID)) {
                    ^
    299.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
    300.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:298:22: Taking false branch
    296.       ASN1_OBJECT ob;
    297.   
    298.       if ((n >= 0) && (n < NUM_NID)) {
                                ^
    299.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
    300.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:304:16: Taking false branch
    302.           }
    303.           return ((ASN1_OBJECT *)&(nid_objs[n]));
    304.       } else if (added == NULL)
                          ^
    305.           return (NULL);
    306.       else {

crypto/objects/obj_dat.c:307:9: 
    305.           return (NULL);
    306.       else {
    307. >         ad.type = ADDED_NID;
    308.           ad.obj = &ob;
    309.           ob.nid = n;

crypto/objects/obj_dat.c:308:9: 
    306.       else {
    307.           ad.type = ADDED_NID;
    308. >         ad.obj = &ob;
    309.           ob.nid = n;
    310.           adp = lh_ADDED_OBJ_retrieve(added, &ad);

crypto/objects/obj_dat.c:309:9: 
    307.           ad.type = ADDED_NID;
    308.           ad.obj = &ob;
    309. >         ob.nid = n;
    310.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
    311.           if (adp != NULL)

crypto/objects/obj_dat.c:310:15: Condition is true
    308.           ad.obj = &ob;
    309.           ob.nid = n;
    310.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
                         ^
    311.           if (adp != NULL)
    312.               return (adp->obj);

crypto/objects/obj_dat.c:310:15: Condition is true
    308.           ad.obj = &ob;
    309.           ob.nid = n;
    310.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
                         ^
    311.           if (adp != NULL)
    312.               return (adp->obj);

crypto/objects/obj_dat.c:310:9: 
    308.           ad.obj = &ob;
    309.           ob.nid = n;
    310. >         adp = lh_ADDED_OBJ_retrieve(added, &ad);
    311.           if (adp != NULL)
    312.               return (adp->obj);

crypto/lhash/lhash.c:217:1: start of procedure lh_retrieve()
      215.   }
      216.   
      217. > void *lh_retrieve(_LHASH *lh, const void *data)
      218.   {
      219.       unsigned long hash;

crypto/lhash/lhash.c:223:5: 
      221.       void *ret;
      222.   
      223. >     lh->error = 0;
      224.       rn = getrn(lh, data, &hash);
      225.   

crypto/lhash/lhash.c:224:5: Skipping getrn(): empty list of specs
      222.   
      223.       lh->error = 0;
      224.       rn = getrn(lh, data, &hash);
                 ^
      225.   
      226.       if (*rn == NULL) {

crypto/lhash/lhash.c:226:9: Taking false branch
      224.       rn = getrn(lh, data, &hash);
      225.   
      226.       if (*rn == NULL) {
                     ^
      227.           lh->num_retrieve_miss++;
      228.           return (NULL);

crypto/lhash/lhash.c:230:9: 
      228.           return (NULL);
      229.       } else {
      230. >         ret = (*rn)->data;
      231.           lh->num_retrieve++;
      232.       }

crypto/lhash/lhash.c:231:9: 
      229.       } else {
      230.           ret = (*rn)->data;
      231. >         lh->num_retrieve++;
      232.       }
      233.       return (ret);

crypto/lhash/lhash.c:233:5: 
      231.           lh->num_retrieve++;
      232.       }
      233. >     return (ret);
      234.   }
      235.   

crypto/lhash/lhash.c:234:1: return from a call to lh_retrieve
      232.       }
      233.       return (ret);
      234. > }
      235.   
      236.   static void doall_util_fn(_LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,

crypto/objects/obj_dat.c:311:13: Taking true branch
    309.           ob.nid = n;
    310.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
    311.           if (adp != NULL)
                       ^
    312.               return (adp->obj);
    313.           else {

crypto/objects/obj_dat.c:312:13: 
    310.           adp = lh_ADDED_OBJ_retrieve(added, &ad);
    311.           if (adp != NULL)
    312. >             return (adp->obj);
    313.           else {
    314.               OBJerr(OBJ_F_OBJ_NID2OBJ, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:318:1: return from a call to OBJ_nid2obj
    316.           }
    317.       }
    318. > }
    319.   
    320.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:192:9: Taking false branch
  190.   
  191.       obj = OBJ_nid2obj(nid);
  192.       if (obj == NULL) {
                 ^
  193.           X509err(X509_F_X509_EXTENSION_CREATE_BY_NID, X509_R_UNKNOWN_NID);
  194.           return (NULL);

crypto/x509/x509_v3.c:196:5: Skipping X509_EXTENSION_create_by_OBJ(): empty list of specs
  194.           return (NULL);
  195.       }
  196.       ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);
             ^
  197.       if (ret == NULL)
  198.           ASN1_OBJECT_free(obj);

crypto/x509/x509_v3.c:197:9: Taking false branch
  195.       }
  196.       ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data);
  197.       if (ret == NULL)
                 ^
  198.           ASN1_OBJECT_free(obj);
  199.       return (ret);

crypto/x509/x509_v3.c:199:5: 
  197.       if (ret == NULL)
  198.           ASN1_OBJECT_free(obj);
  199. >     return (ret);
  200.   }
  201.   

crypto/x509/x509_v3.c:200:1: return from a call to X509_EXTENSION_create_by_NID
  198.           ASN1_OBJECT_free(obj);
  199.       return (ret);
  200. > }
  201.   
  202.   X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,

crypto/x509v3/v3_conf.c:208:10: Taking false branch
206.   
207.       ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
208.       if (!ext)
                ^
209.           goto merr;
210.       ASN1_OCTET_STRING_free(ext_oct);

crypto/x509v3/v3_conf.c:210:5: 
208.       if (!ext)
209.           goto merr;
210. >     ASN1_OCTET_STRING_free(ext_oct);
211.   
212.       return ext;

crypto/asn1/tasn_typ.c:77:1: start of procedure ASN1_OCTET_STRING_free()
  75.   }
  76.   
  77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  78.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)

crypto/asn1/asn1_lib.c:362:1: start of procedure ASN1_STRING_free()
    360.   }
    361.   
    362. > void ASN1_STRING_free(ASN1_STRING *a)
    363.   {
    364.       if (a == NULL)

crypto/asn1/asn1_lib.c:364:9: Taking false branch
    362.   void ASN1_STRING_free(ASN1_STRING *a)
    363.   {
    364.       if (a == NULL)
                   ^
    365.           return;
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))

crypto/asn1/asn1_lib.c:366:11: Taking false branch
    364.       if (a == NULL)
    365.           return;
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
                     ^
    367.           OPENSSL_free(a->data);
    368.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))

crypto/asn1/asn1_lib.c:368:11: Taking false branch
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    367.           OPENSSL_free(a->data);
    368.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
                     ^
    369.           OPENSSL_free(a);
    370.   }

crypto/asn1/asn1_lib.c:368:5: 
    366.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
    367.           OPENSSL_free(a->data);
    368. >     if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    369.           OPENSSL_free(a);
    370.   }

crypto/asn1/asn1_lib.c:370:1: return from a call to ASN1_STRING_free
    368.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
    369.           OPENSSL_free(a);
    370. > }
    371.   
    372.   void ASN1_STRING_clear_free(ASN1_STRING *a)

crypto/asn1/tasn_typ.c:77:1: return from a call to ASN1_OCTET_STRING_free
  75.   }
  76.   
  77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
  78.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
  79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
