crypto/pem/pem_info.c:159: error: MEMORY_LEAK
  memory dynamically allocated by call to `X509_INFO_new()` at line 60, column 15 is not reachable after line 159, column 27.
Showing all 83 steps of the trace


crypto/pem/pem_info.c:38:1: start of procedure PEM_X509_INFO_read_bio()
36.   #endif
37.   
38. > STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk,
39.                                               pem_password_cb *cb, void *u)
40.   {

crypto/pem/pem_info.c:41:5: 
39.                                               pem_password_cb *cb, void *u)
40.   {
41. >     X509_INFO *xi = NULL;
42.       char *name = NULL, *header = NULL;
43.       void *pp;

crypto/pem/pem_info.c:42:5: 
40.   {
41.       X509_INFO *xi = NULL;
42. >     char *name = NULL, *header = NULL;
43.       void *pp;
44.       unsigned char *data = NULL;

crypto/pem/pem_info.c:44:5: 
42.       char *name = NULL, *header = NULL;
43.       void *pp;
44. >     unsigned char *data = NULL;
45.       const unsigned char *p;
46.       long len, error = 0;

crypto/pem/pem_info.c:46:5: 
44.       unsigned char *data = NULL;
45.       const unsigned char *p;
46. >     long len, error = 0;
47.       int ok = 0;
48.       STACK_OF(X509_INFO) *ret = NULL;

crypto/pem/pem_info.c:47:5: 
45.       const unsigned char *p;
46.       long len, error = 0;
47. >     int ok = 0;
48.       STACK_OF(X509_INFO) *ret = NULL;
49.       unsigned int i, raw, ptype;

crypto/pem/pem_info.c:48:5: 
46.       long len, error = 0;
47.       int ok = 0;
48. >     STACK_OF(X509_INFO) *ret = NULL;
49.       unsigned int i, raw, ptype;
50.       d2i_of_void *d2i = 0;

crypto/pem/pem_info.c:50:5: 
48.       STACK_OF(X509_INFO) *ret = NULL;
49.       unsigned int i, raw, ptype;
50. >     d2i_of_void *d2i = 0;
51.   
52.       if (sk == NULL) {

crypto/pem/pem_info.c:52:9: Taking true branch
50.       d2i_of_void *d2i = 0;
51.   
52.       if (sk == NULL) {
              ^
53.           if ((ret = sk_X509_INFO_new_null()) == NULL) {
54.               PEMerr(PEM_F_PEM_X509_INFO_READ_BIO, ERR_R_MALLOC_FAILURE);

crypto/pem/pem_info.c:53:13: 
51.   
52.       if (sk == NULL) {
53. >         if ((ret = sk_X509_INFO_new_null()) == NULL) {
54.               PEMerr(PEM_F_PEM_X509_INFO_READ_BIO, ERR_R_MALLOC_FAILURE);
55.               goto err;

include/openssl/x509.h:253:1: start of procedure sk_X509_INFO_new_null()
  251.   } X509_INFO;
  252.   
  253. > DEFINE_STACK_OF(X509_INFO)
  254.   
  255.   /*

crypto/stack/stack.c:92:1: start of procedure OPENSSL_sk_new_null()
    90.   }
    91.   
    92. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    93.   {
    94.       return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL);

crypto/stack/stack.c:94:5: Skipping OPENSSL_sk_new(): empty list of specs
    92.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    93.   {
    94.       return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL);
              ^
    95.   }
    96.   

crypto/stack/stack.c:95:1: return from a call to OPENSSL_sk_new_null
    93.   {
    94.       return OPENSSL_sk_new((OPENSSL_sk_compfunc)NULL);
    95. > }
    96.   
    97.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

include/openssl/x509.h:253:1: return from a call to sk_X509_INFO_new_null
  251.   } X509_INFO;
  252.   
  253. > DEFINE_STACK_OF(X509_INFO)
  254.   
  255.   /*

crypto/pem/pem_info.c:53:13: Taking false branch
51.   
52.       if (sk == NULL) {
53.           if ((ret = sk_X509_INFO_new_null()) == NULL) {
                  ^
54.               PEMerr(PEM_F_PEM_X509_INFO_READ_BIO, ERR_R_MALLOC_FAILURE);
55.               goto err;

crypto/pem/pem_info.c:60:9: 
58.           ret = sk;
59.   
60. >     if ((xi = X509_INFO_new()) == NULL)
61.           goto err;
62.       for (;;) {

crypto/asn1/x_info.c:16:1: start of procedure X509_INFO_new()
  14.   #include <openssl/x509.h>
  15.   
  16. > X509_INFO *X509_INFO_new(void)
  17.   {
  18.       X509_INFO *ret;

crypto/asn1/x_info.c:20:5: 
  18.       X509_INFO *ret;
  19.   
  20. >     ret = OPENSSL_zalloc(sizeof(*ret));
  21.       if (ret == NULL) {
  22.           ASN1err(ASN1_F_X509_INFO_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
    96.   }
    97.   
    98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100. >     void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)

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/mem.c:102:9: Taking true branch
    100.       void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)
                   ^
    103.           memset(ret, 0, num);
    104.       return ret;

crypto/mem.c:103:9: 
    101.   
    102.       if (ret != NULL)
    103. >         memset(ret, 0, num);
    104.       return ret;
    105.   }

crypto/mem.c:104:5: 
    102.       if (ret != NULL)
    103.           memset(ret, 0, num);
    104. >     return ret;
    105.   }
    106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
    103.           memset(ret, 0, num);
    104.       return ret;
    105. > }
    106.   
    107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/asn1/x_info.c:21:9: Taking false branch
  19.   
  20.       ret = OPENSSL_zalloc(sizeof(*ret));
  21.       if (ret == NULL) {
                ^
  22.           ASN1err(ASN1_F_X509_INFO_NEW, ERR_R_MALLOC_FAILURE);
  23.           return NULL;

crypto/asn1/x_info.c:26:5: 
  24.       }
  25.   
  26. >     return ret;
  27.   }
  28.   

crypto/asn1/x_info.c:27:1: return from a call to X509_INFO_new
  25.   
  26.       return ret;
  27. > }
  28.   
  29.   void X509_INFO_free(X509_INFO *x)

crypto/pem/pem_info.c:60:9: Taking false branch
58.           ret = sk;
59.   
60.       if ((xi = X509_INFO_new()) == NULL)
              ^
61.           goto err;
62.       for (;;) {

crypto/pem/pem_info.c:215:5: Loop condition is true. Entering loop body
213.           OPENSSL_free(data);
214.           data = NULL;
215.       }
           ^
216.   
217.       /*

crypto/pem/pem_info.c:63:9: 
61.           goto err;
62.       for (;;) {
63. >         raw = 0;
64.           ptype = 0;
65.           i = PEM_read_bio(bp, &name, &header, &data, &len);

crypto/pem/pem_info.c:64:9: 
62.       for (;;) {
63.           raw = 0;
64. >         ptype = 0;
65.           i = PEM_read_bio(bp, &name, &header, &data, &len);
66.           if (i == 0) {

crypto/pem/pem_info.c:65:9: Skipping PEM_read_bio(): empty list of specs
63.           raw = 0;
64.           ptype = 0;
65.           i = PEM_read_bio(bp, &name, &header, &data, &len);
              ^
66.           if (i == 0) {
67.               error = ERR_GET_REASON(ERR_peek_last_error());

crypto/pem/pem_info.c:66:13: Taking false branch
64.           ptype = 0;
65.           i = PEM_read_bio(bp, &name, &header, &data, &len);
66.           if (i == 0) {
                  ^
67.               error = ERR_GET_REASON(ERR_peek_last_error());
68.               if (error == PEM_R_NO_START_LINE) {

crypto/pem/pem_info.c:83:17: 
81.                   if ((xi = X509_INFO_new()) == NULL)
82.                       goto err;
83. >                 goto start;
84.               }
85.               pp = &(xi->x509);

crypto/pem/pem_info.c:75:14: Taking false branch
73.           }
74.    start:
75.           if ((strcmp(name, PEM_STRING_X509) == 0) ||
                   ^
76.               (strcmp(name, PEM_STRING_X509_OLD) == 0)) {
77.               d2i = (D2I_OF(void)) d2i_X509;

crypto/pem/pem_info.c:76:14: Taking false branch
74.    start:
75.           if ((strcmp(name, PEM_STRING_X509) == 0) ||
76.               (strcmp(name, PEM_STRING_X509_OLD) == 0)) {
                   ^
77.               d2i = (D2I_OF(void)) d2i_X509;
78.               if (xi->x509 != NULL) {

crypto/pem/pem_info.c:86:21: Taking false branch
84.               }
85.               pp = &(xi->x509);
86.           } else if ((strcmp(name, PEM_STRING_X509_TRUSTED) == 0)) {
                          ^
87.               d2i = (D2I_OF(void)) d2i_X509_AUX;
88.               if (xi->x509 != NULL) {

crypto/pem/pem_info.c:96:20: Taking false branch
94.               }
95.               pp = &(xi->x509);
96.           } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) {
                         ^
97.               d2i = (D2I_OF(void)) d2i_X509_CRL;
98.               if (xi->crl != NULL) {

crypto/pem/pem_info.c:108:13: Taking false branch
106.           } else
107.   #ifndef OPENSSL_NO_RSA
108.           if (strcmp(name, PEM_STRING_RSA) == 0) {
                   ^
109.               d2i = (D2I_OF(void)) d2i_RSAPrivateKey;
110.               if (xi->x_pkey != NULL) {

crypto/pem/pem_info.c:131:13: Taking false branch
129.   #endif
130.   #ifndef OPENSSL_NO_DSA
131.           if (strcmp(name, PEM_STRING_DSA) == 0) {
                   ^
132.               d2i = (D2I_OF(void)) d2i_DSAPrivateKey;
133.               if (xi->x_pkey != NULL) {

crypto/pem/pem_info.c:154:13: Taking true branch
152.   #endif
153.   #ifndef OPENSSL_NO_EC
154.           if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) {
                   ^
155.               d2i = (D2I_OF(void)) d2i_ECPrivateKey;
156.               if (xi->x_pkey != NULL) {

crypto/pem/pem_info.c:155:13: 
153.   #ifndef OPENSSL_NO_EC
154.           if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) {
155. >             d2i = (D2I_OF(void)) d2i_ECPrivateKey;
156.               if (xi->x_pkey != NULL) {
157.                   if (!sk_X509_INFO_push(ret, xi))

crypto/pem/pem_info.c:156:17: Taking true branch
154.           if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) {
155.               d2i = (D2I_OF(void)) d2i_ECPrivateKey;
156.               if (xi->x_pkey != NULL) {
                       ^
157.                   if (!sk_X509_INFO_push(ret, xi))
158.                       goto err;

crypto/pem/pem_info.c:157:22: 
155.               d2i = (D2I_OF(void)) d2i_ECPrivateKey;
156.               if (xi->x_pkey != NULL) {
157. >                 if (!sk_X509_INFO_push(ret, xi))
158.                       goto err;
159.                   if ((xi = X509_INFO_new()) == NULL)

include/openssl/x509.h:253:1: start of procedure sk_X509_INFO_push()
  251.   } X509_INFO;
  252.   
  253. > DEFINE_STACK_OF(X509_INFO)
  254.   
  255.   /*

crypto/stack/stack.c:200:1: start of procedure OPENSSL_sk_push()
    198.   }
    199.   
    200. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));

crypto/stack/stack.c:202:5: Skipping OPENSSL_sk_insert(): empty list of specs
    200.   int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));
               ^
    203.   }
    204.   

crypto/stack/stack.c:203:1: return from a call to OPENSSL_sk_push
    201.   {
    202.       return (OPENSSL_sk_insert(st, data, st->num));
    203. > }
    204.   
    205.   int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)

include/openssl/x509.h:253:1: return from a call to sk_X509_INFO_push
  251.   } X509_INFO;
  252.   
  253. > DEFINE_STACK_OF(X509_INFO)
  254.   
  255.   /*

crypto/pem/pem_info.c:157:22: Taking false branch
155.               d2i = (D2I_OF(void)) d2i_ECPrivateKey;
156.               if (xi->x_pkey != NULL) {
157.                   if (!sk_X509_INFO_push(ret, xi))
                            ^
158.                       goto err;
159.                   if ((xi = X509_INFO_new()) == NULL)

crypto/pem/pem_info.c:159:21: 
157.                   if (!sk_X509_INFO_push(ret, xi))
158.                       goto err;
159. >                 if ((xi = X509_INFO_new()) == NULL)
160.                       goto err;
161.                   goto start;

crypto/asn1/x_info.c:16:1: start of procedure X509_INFO_new()
  14.   #include <openssl/x509.h>
  15.   
  16. > X509_INFO *X509_INFO_new(void)
  17.   {
  18.       X509_INFO *ret;

crypto/asn1/x_info.c:20:5: 
  18.       X509_INFO *ret;
  19.   
  20. >     ret = OPENSSL_zalloc(sizeof(*ret));
  21.       if (ret == NULL) {
  22.           ASN1err(ASN1_F_X509_INFO_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
    96.   }
    97.   
    98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100. >     void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)

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/mem.c:102:9: Taking true branch
    100.       void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)
                   ^
    103.           memset(ret, 0, num);
    104.       return ret;

crypto/mem.c:103:9: 
    101.   
    102.       if (ret != NULL)
    103. >         memset(ret, 0, num);
    104.       return ret;
    105.   }

crypto/mem.c:104:5: 
    102.       if (ret != NULL)
    103.           memset(ret, 0, num);
    104. >     return ret;
    105.   }
    106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
    103.           memset(ret, 0, num);
    104.       return ret;
    105. > }
    106.   
    107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/asn1/x_info.c:21:9: Taking false branch
  19.   
  20.       ret = OPENSSL_zalloc(sizeof(*ret));
  21.       if (ret == NULL) {
                ^
  22.           ASN1err(ASN1_F_X509_INFO_NEW, ERR_R_MALLOC_FAILURE);
  23.           return NULL;

crypto/asn1/x_info.c:26:5: 
  24.       }
  25.   
  26. >     return ret;
  27.   }
  28.   

crypto/asn1/x_info.c:27:1: return from a call to X509_INFO_new
  25.   
  26.       return ret;
  27. > }
  28.   
  29.   void X509_INFO_free(X509_INFO *x)
