test/crltest.c:270: error: MEMORY_LEAK
  memory dynamically allocated by call to `X509_STORE_CTX_new()` at line 235, column 27 is not reachable after line 270, column 5.
Showing all 71 steps of the trace


test/crltest.c:232:1: start of procedure verify()
230.    * Returns a value from X509_V_ERR_xxx or X509_V_OK.
231.    */
232. > static int verify(X509 *leaf, X509 *root, STACK_OF(X509_CRL) *crls,
233.                     unsigned long flags)
234.   {

test/crltest.c:235:5: 
233.                     unsigned long flags)
234.   {
235. >     X509_STORE_CTX *ctx = X509_STORE_CTX_new();
236.       X509_STORE *store = X509_STORE_new();
237.       X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new();

crypto/x509/x509_vfy.c:2151:1: start of procedure X509_STORE_CTX_new()
  2149.   }
  2150.   
  2151. > X509_STORE_CTX *X509_STORE_CTX_new(void)
  2152.   {
  2153.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/x509/x509_vfy.c:2153:5: 
  2151.   X509_STORE_CTX *X509_STORE_CTX_new(void)
  2152.   {
  2153. >     X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2154.   
  2155.       if (ctx == NULL) {

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
    216.   }
    217.   
    218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    219.   {
    220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    219.   {
    220. >     void *ret = CRYPTO_malloc(num, file, line);
    221.   
    222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
      187.   #endif
      188.   
      189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      190.   {
      191.       void *ret = NULL;

crypto/mem.c:191:5: 
      189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      190.   {
      191. >     void *ret = NULL;
      192.   
      193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking false branch
      192.   
      193.       INCREMENT(malloc_count);
      194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      195.           return malloc_impl(num, file, line);
      196.   

crypto/mem.c:197:9: Taking false branch
      195.           return malloc_impl(num, file, line);
      196.   
      197.       if (num == 0)
                     ^
      198.           return NULL;
      199.   

crypto/mem.c:201:5: 
      199.   
      200.       FAILTEST();
      201. >     allow_customize = 0;
      202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      203.       if (call_malloc_debug) {

crypto/mem.c:211:5: 
      209.       }
      210.   #else
      211. >     (void)(file); (void)(line);
      212.       ret = malloc(num);
      213.   #endif

crypto/mem.c:211:19: 
      209.       }
      210.   #else
      211. >     (void)(file); (void)(line);
      212.       ret = malloc(num);
      213.   #endif

crypto/mem.c:212:5: 
      210.   #else
      211.       (void)(file); (void)(line);
      212. >     ret = malloc(num);
      213.   #endif
      214.   

crypto/mem.c:215:5: 
      213.   #endif
      214.   
      215. >     return ret;
      216.   }
      217.   

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
      214.   
      215.       return ret;
      216. > }
      217.   
      218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking true branch
    221.   
    222.       FAILTEST();
    223.       if (ret != NULL)
                   ^
    224.           memset(ret, 0, num);
    225.       return ret;

crypto/mem.c:224:9: 
    222.       FAILTEST();
    223.       if (ret != NULL)
    224. >         memset(ret, 0, num);
    225.       return ret;
    226.   }

crypto/mem.c:225:5: 
    223.       if (ret != NULL)
    224.           memset(ret, 0, num);
    225. >     return ret;
    226.   }
    227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
    224.           memset(ret, 0, num);
    225.       return ret;
    226. > }
    227.   
    228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2155:9: Taking false branch
  2153.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2154.   
  2155.       if (ctx == NULL) {
                  ^
  2156.           X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
  2157.           return NULL;

crypto/x509/x509_vfy.c:2159:5: 
  2157.           return NULL;
  2158.       }
  2159. >     return ctx;
  2160.   }
  2161.   

crypto/x509/x509_vfy.c:2160:1: return from a call to X509_STORE_CTX_new
  2158.       }
  2159.       return ctx;
  2160. > }
  2161.   
  2162.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)

test/crltest.c:236:5: Skipping X509_STORE_new(): empty list of specs
234.   {
235.       X509_STORE_CTX *ctx = X509_STORE_CTX_new();
236.       X509_STORE *store = X509_STORE_new();
           ^
237.       X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new();
238.       STACK_OF(X509) *roots = sk_X509_new_null();

test/crltest.c:237:5: Skipping X509_VERIFY_PARAM_new(): empty list of specs
235.       X509_STORE_CTX *ctx = X509_STORE_CTX_new();
236.       X509_STORE *store = X509_STORE_new();
237.       X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new();
           ^
238.       STACK_OF(X509) *roots = sk_X509_new_null();
239.       int status = X509_V_ERR_UNSPECIFIED;

test/crltest.c:238:5: 
236.       X509_STORE *store = X509_STORE_new();
237.       X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new();
238. >     STACK_OF(X509) *roots = sk_X509_new_null();
239.       int status = X509_V_ERR_UNSPECIFIED;
240.   

include/openssl/x509.h:99:1: start of procedure sk_X509_new_null()
  97.   typedef struct x509_cinf_st X509_CINF;
  98.   
  99. > DEFINE_STACK_OF(X509)
  100.   
  101.   /* This is used for a table of trust checking functions */

crypto/stack/stack.c:112:1: start of procedure OPENSSL_sk_new_null()
    110.   }
    111.   
    112. > OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114.       return OPENSSL_sk_new_reserve(NULL, 0);

crypto/stack/stack.c:114:5: Skipping OPENSSL_sk_new_reserve(): empty list of specs
    112.   OPENSSL_STACK *OPENSSL_sk_new_null(void)
    113.   {
    114.       return OPENSSL_sk_new_reserve(NULL, 0);
               ^
    115.   }
    116.   

crypto/stack/stack.c:115:1: return from a call to OPENSSL_sk_new_null
    113.   {
    114.       return OPENSSL_sk_new_reserve(NULL, 0);
    115. > }
    116.   
    117.   OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)

include/openssl/x509.h:99:1: return from a call to sk_X509_new_null
  97.   typedef struct x509_cinf_st X509_CINF;
  98.   
  99. > DEFINE_STACK_OF(X509)
  100.   
  101.   /* This is used for a table of trust checking functions */

test/crltest.c:239:5: 
237.       X509_VERIFY_PARAM *param = X509_VERIFY_PARAM_new();
238.       STACK_OF(X509) *roots = sk_X509_new_null();
239. >     int status = X509_V_ERR_UNSPECIFIED;
240.   
241.       if (!TEST_ptr(ctx)

test/crltest.c:241:10: 
239.       int status = X509_V_ERR_UNSPECIFIED;
240.   
241. >     if (!TEST_ptr(ctx)
242.           || !TEST_ptr(store)
243.           || !TEST_ptr(param)

test/testutil/tests.c:227:1: start of procedure test_ptr()
  225.   }
  226.   
  227. > int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)

test/testutil/tests.c:229:9: Taking true branch
  227.   int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)
                 ^
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:230:9: 
  228.   {
  229.       if (p != NULL)
  230. >         return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;

test/testutil/tests.c:233:1: return from a call to test_ptr
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;
  233. > }
  234.   
  235.   int test_true(const char *file, int line, const char *s, int b)

test/crltest.c:241:10: Taking false branch
239.       int status = X509_V_ERR_UNSPECIFIED;
240.   
241.       if (!TEST_ptr(ctx)
                ^
242.           || !TEST_ptr(store)
243.           || !TEST_ptr(param)

test/crltest.c:242:13: 
240.   
241.       if (!TEST_ptr(ctx)
242. >         || !TEST_ptr(store)
243.           || !TEST_ptr(param)
244.           || !TEST_ptr(roots))

test/testutil/tests.c:227:1: start of procedure test_ptr()
  225.   }
  226.   
  227. > int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)

test/testutil/tests.c:229:9: Taking true branch
  227.   int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)
                 ^
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:230:9: 
  228.   {
  229.       if (p != NULL)
  230. >         return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;

test/testutil/tests.c:233:1: return from a call to test_ptr
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;
  233. > }
  234.   
  235.   int test_true(const char *file, int line, const char *s, int b)

test/crltest.c:242:13: Taking false branch
240.   
241.       if (!TEST_ptr(ctx)
242.           || !TEST_ptr(store)
                   ^
243.           || !TEST_ptr(param)
244.           || !TEST_ptr(roots))

test/crltest.c:243:13: 
241.       if (!TEST_ptr(ctx)
242.           || !TEST_ptr(store)
243. >         || !TEST_ptr(param)
244.           || !TEST_ptr(roots))
245.           goto err;

test/testutil/tests.c:227:1: start of procedure test_ptr()
  225.   }
  226.   
  227. > int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)

test/testutil/tests.c:229:9: Taking false branch
  227.   int test_ptr(const char *file, int line, const char *s, const void *p)
  228.   {
  229.       if (p != NULL)
                 ^
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:231:5: Skipping test_fail_message(): empty list of specs
  229.       if (p != NULL)
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
             ^
  232.       return 0;
  233.   }

test/testutil/tests.c:232:5: 
  230.           return 1;
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232. >     return 0;
  233.   }
  234.   

test/testutil/tests.c:233:1: return from a call to test_ptr
  231.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  232.       return 0;
  233. > }
  234.   
  235.   int test_true(const char *file, int line, const char *s, int b)

test/crltest.c:243:13: Taking true branch
241.       if (!TEST_ptr(ctx)
242.           || !TEST_ptr(store)
243.           || !TEST_ptr(param)
                   ^
244.           || !TEST_ptr(roots))
245.           goto err;

test/crltest.c:266:1: 
264.       status = X509_verify_cert(ctx) == 1 ? X509_V_OK
265.                                           : X509_STORE_CTX_get_error(ctx);
266. > err:
267.       sk_X509_pop_free(roots, X509_free);
268.       sk_X509_CRL_pop_free(crls, X509_CRL_free);

test/crltest.c:267:5: 
265.                                           : X509_STORE_CTX_get_error(ctx);
266.   err:
267. >     sk_X509_pop_free(roots, X509_free);
268.       sk_X509_CRL_pop_free(crls, X509_CRL_free);
269.       X509_VERIFY_PARAM_free(param);

include/openssl/x509.h:99:1: start of procedure sk_X509_pop_free()
  97.   typedef struct x509_cinf_st X509_CINF;
  98.   
  99. > DEFINE_STACK_OF(X509)
  100.   
  101.   /* This is used for a table of trust checking functions */

include/openssl/x509.h:99:1: return from a call to sk_X509_pop_free
  97.   typedef struct x509_cinf_st X509_CINF;
  98.   
  99. > DEFINE_STACK_OF(X509)
  100.   
  101.   /* This is used for a table of trust checking functions */

test/crltest.c:268:5: 
266.   err:
267.       sk_X509_pop_free(roots, X509_free);
268. >     sk_X509_CRL_pop_free(crls, X509_CRL_free);
269.       X509_VERIFY_PARAM_free(param);
270.       X509_STORE_CTX_free(ctx);

include/openssl/x509.h:228:1: start of procedure sk_X509_CRL_pop_free()
  226.   typedef struct X509_crl_info_st X509_CRL_INFO;
  227.   
  228. > DEFINE_STACK_OF(X509_CRL)
  229.   
  230.   typedef struct private_key_st {

include/openssl/x509.h:228:1: return from a call to sk_X509_CRL_pop_free
  226.   typedef struct X509_crl_info_st X509_CRL_INFO;
  227.   
  228. > DEFINE_STACK_OF(X509_CRL)
  229.   
  230.   typedef struct private_key_st {

test/crltest.c:269:5: Skipping X509_VERIFY_PARAM_free(): empty list of specs
267.       sk_X509_pop_free(roots, X509_free);
268.       sk_X509_CRL_pop_free(crls, X509_CRL_free);
269.       X509_VERIFY_PARAM_free(param);
           ^
270.       X509_STORE_CTX_free(ctx);
271.       X509_STORE_free(store);

test/crltest.c:270:5: 
268.       sk_X509_CRL_pop_free(crls, X509_CRL_free);
269.       X509_VERIFY_PARAM_free(param);
270. >     X509_STORE_CTX_free(ctx);
271.       X509_STORE_free(store);
272.       return status;

crypto/x509/x509_vfy.c:2162:1: start of procedure X509_STORE_CTX_free()
  2160.   }
  2161.   
  2162. > void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2163.   {
  2164.       if (ctx == NULL)

crypto/x509/x509_vfy.c:2164:9: Taking false branch
  2162.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2163.   {
  2164.       if (ctx == NULL)
                  ^
  2165.           return;
  2166.   

crypto/x509/x509_vfy.c:2167:5: Skipping X509_STORE_CTX_cleanup(): empty list of specs
  2165.           return;
  2166.   
  2167.       X509_STORE_CTX_cleanup(ctx);
              ^
  2168.       OPENSSL_free(ctx);
  2169.   }

crypto/x509/x509_vfy.c:2168:5: 
  2166.   
  2167.       X509_STORE_CTX_cleanup(ctx);
  2168. >     OPENSSL_free(ctx);
  2169.   }
  2170.   

crypto/mem.c:286:1: start of procedure CRYPTO_free()
    284.   }
    285.   
    286. > void CRYPTO_free(void *str, const char *file, int line)
    287.   {
    288.       INCREMENT(free_count);

crypto/mem.c:289:9: Taking true branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:289:30: Taking true branch
    287.   {
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    290.           free_impl(str, file, line);
    291.           return;

crypto/mem.c:290:9: Skipping __function_pointer__(): unresolved function pointer
    288.       INCREMENT(free_count);
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    290.           free_impl(str, file, line);
                   ^
    291.           return;
    292.       }

crypto/mem.c:291:9: 
    289.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    290.           free_impl(str, file, line);
    291. >         return;
    292.       }
    293.   

crypto/mem.c:305:1: return from a call to CRYPTO_free
    303.       free(str);
    304.   #endif
    305. > }
    306.   
    307.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2169:1: return from a call to X509_STORE_CTX_free
  2167.       X509_STORE_CTX_cleanup(ctx);
  2168.       OPENSSL_free(ctx);
  2169. > }
  2170.   
  2171.   int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
