test/sslapitest.c:2581: error: MEMORY_LEAK
  memory dynamically allocated by call to `SSL_CONF_CTX_new()` at line 2572, column 37 is not reachable after line 2581, column 17.
Showing all 70 steps of the trace


test/sslapitest.c:2552:1: start of procedure test_early_data_replay_int()
2550.    * confopt == 1: Configure anti-replay using SSL_CONF
2551.    */
2552. > static int test_early_data_replay_int(int idx, int usecb, int confopt)
2553.   {
2554.       SSL_CTX *cctx = NULL, *sctx = NULL;

test/sslapitest.c:2554:5: 
2552.   static int test_early_data_replay_int(int idx, int usecb, int confopt)
2553.   {
2554. >     SSL_CTX *cctx = NULL, *sctx = NULL;
2555.       SSL *clientssl = NULL, *serverssl = NULL;
2556.       int testresult = 0;

test/sslapitest.c:2555:5: 
2553.   {
2554.       SSL_CTX *cctx = NULL, *sctx = NULL;
2555. >     SSL *clientssl = NULL, *serverssl = NULL;
2556.       int testresult = 0;
2557.       SSL_SESSION *sess = NULL;

test/sslapitest.c:2556:5: 
2554.       SSL_CTX *cctx = NULL, *sctx = NULL;
2555.       SSL *clientssl = NULL, *serverssl = NULL;
2556. >     int testresult = 0;
2557.       SSL_SESSION *sess = NULL;
2558.       size_t readbytes, written;

test/sslapitest.c:2557:5: 
2555.       SSL *clientssl = NULL, *serverssl = NULL;
2556.       int testresult = 0;
2557. >     SSL_SESSION *sess = NULL;
2558.       size_t readbytes, written;
2559.       unsigned char buf[20];

test/sslapitest.c:2561:5: 
2559.       unsigned char buf[20];
2560.   
2561. >     allow_ed_cb_called = 0;
2562.   
2563.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),

test/sslapitest.c:2563:10: 
2561.       allow_ed_cb_called = 0;
2562.   
2563. >     if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
2564.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2565.                                          &cctx, cert, privkey)))

ssl/methods.c:49:1: start of procedure TLS_server_method()
  47.    * TLS/SSLv3 server methods
  48.    */
  49. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  50.                           TLS_server_method,
  51.                           ossl_statem_accept,

ssl/methods.c:49:1: return from a call to TLS_server_method
  47.    * TLS/SSLv3 server methods
  48.    */
  49. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  50.                           TLS_server_method,
  51.                           ossl_statem_accept,

ssl/methods.c:82:1: start of procedure TLS_client_method()
  80.    * TLS/SSLv3 client methods
  81.    */
  82. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  83.                           TLS_client_method,
  84.                           ssl_undefined_function,

ssl/methods.c:82:1: return from a call to TLS_client_method
  80.    * TLS/SSLv3 client methods
  81.    */
  82. > IMPLEMENT_tls_meth_func(TLS_ANY_VERSION, 0, 0,
  83.                           TLS_client_method,
  84.                           ssl_undefined_function,

test/sslapitest.c:2563:10: Condition is true
2561.       allow_ed_cb_called = 0;
2562.   
2563.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2564.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2565.                                          &cctx, cert, privkey)))

test/testutil/tests.c:236:1: start of procedure test_true()
  234.   }
  235.   
  236. > int test_true(const char *file, int line, const char *s, int b)
  237.   {
  238.       if (b)

test/testutil/tests.c:238:9: Taking true branch
  236.   int test_true(const char *file, int line, const char *s, int b)
  237.   {
  238.       if (b)
                 ^
  239.           return 1;
  240.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");

test/testutil/tests.c:239:9: 
  237.   {
  238.       if (b)
  239. >         return 1;
  240.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  241.       return 0;

test/testutil/tests.c:242:1: return from a call to test_true
  240.       test_fail_message(NULL, file, line, "bool", s, "true", "==", "false");
  241.       return 0;
  242. > }
  243.   
  244.   int test_false(const char *file, int line, const char *s, int b)

test/sslapitest.c:2563:10: Taking false branch
2561.       allow_ed_cb_called = 0;
2562.   
2563.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2564.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2565.                                          &cctx, cert, privkey)))

test/sslapitest.c:2568:9: Taking true branch
2566.           return 0;
2567.   
2568.       if (usecb > 0) {
                ^
2569.           if (confopt == 0) {
2570.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);

test/sslapitest.c:2569:13: Taking false branch
2567.   
2568.       if (usecb > 0) {
2569.           if (confopt == 0) {
                    ^
2570.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2571.           } else {

test/sslapitest.c:2572:13: 
2570.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2571.           } else {
2572. >             SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2573.   
2574.               if (!TEST_ptr(confctx))

ssl/ssl_conf.c:872:1: start of procedure SSL_CONF_CTX_new()
  870.   }
  871.   
  872. > SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  873.   {
  874.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));

ssl/ssl_conf.c:874:5: 
  872.   SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  873.   {
  874. >     SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  875.   
  876.       return ret;

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
    226.   }
    227.   
    228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230. >     void *ret = CRYPTO_malloc(num, file, line);
    231.   
    232.       FAILTEST();

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

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

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

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

crypto/mem.c:204:9: Taking true branch
      202.   
      203.       FAILTEST();
      204.       if (allow_customize) {
                     ^
      205.           /*
      206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
      208.            * allocation.
      209.            */
      210. >         allow_customize = 0;
      211.       }
      212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:221:19: 
      219.       }
      220.   #else
      221. >     (void)(file); (void)(line);
      222.       ret = malloc(num);
      223.   #endif

crypto/mem.c:222:5: 
      220.   #else
      221.       (void)(file); (void)(line);
      222. >     ret = malloc(num);
      223.   #endif
      224.   

crypto/mem.c:225:5: 
      223.   #endif
      224.   
      225. >     return ret;
      226.   }
      227.   

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

crypto/mem.c:233:9: Taking true branch
    231.   
    232.       FAILTEST();
    233.       if (ret != NULL)
                   ^
    234.           memset(ret, 0, num);
    235.       return ret;

crypto/mem.c:234:9: 
    232.       FAILTEST();
    233.       if (ret != NULL)
    234. >         memset(ret, 0, num);
    235.       return ret;
    236.   }

crypto/mem.c:235:5: 
    233.       if (ret != NULL)
    234.           memset(ret, 0, num);
    235. >     return ret;
    236.   }
    237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
    234.           memset(ret, 0, num);
    235.       return ret;
    236. > }
    237.   
    238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/ssl_conf.c:876:5: 
  874.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  875.   
  876. >     return ret;
  877.   }
  878.   

ssl/ssl_conf.c:877:1: return from a call to SSL_CONF_CTX_new
  875.   
  876.       return ret;
  877. > }
  878.   
  879.   int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx)

test/sslapitest.c:2574:18: 
2572.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2573.   
2574. >             if (!TEST_ptr(confctx))
2575.                   goto end;
2576.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

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

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

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

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

test/sslapitest.c:2574:18: Taking false branch
2572.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2573.   
2574.               if (!TEST_ptr(confctx))
                         ^
2575.                   goto end;
2576.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

test/sslapitest.c:2576:13: 
2574.               if (!TEST_ptr(confctx))
2575.                   goto end;
2576. >             SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2577.                                               | SSL_CONF_FLAG_SERVER);
2578.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);

ssl/ssl_conf.c:924:1: start of procedure SSL_CONF_CTX_set_flags()
  922.   }
  923.   
  924. > unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
  925.   {
  926.       cctx->flags |= flags;

ssl/ssl_conf.c:926:5: 
  924.   unsigned int SSL_CONF_CTX_set_flags(SSL_CONF_CTX *cctx, unsigned int flags)
  925.   {
  926. >     cctx->flags |= flags;
  927.       return cctx->flags;
  928.   }

ssl/ssl_conf.c:927:5: 
  925.   {
  926.       cctx->flags |= flags;
  927. >     return cctx->flags;
  928.   }
  929.   

ssl/ssl_conf.c:928:1: return from a call to SSL_CONF_CTX_set_flags
  926.       cctx->flags |= flags;
  927.       return cctx->flags;
  928. > }
  929.   
  930.   unsigned int SSL_CONF_CTX_clear_flags(SSL_CONF_CTX *cctx, unsigned int flags)

test/sslapitest.c:2578:13: 
2576.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2577.                                               | SSL_CONF_FLAG_SERVER);
2578. >             SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2579.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2580.                                2)) {

ssl/ssl_conf.c:972:1: start of procedure SSL_CONF_CTX_set_ssl_ctx()
  970.   }
  971.   
  972. > void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)
  973.   {
  974.       cctx->ctx = ctx;

ssl/ssl_conf.c:974:5: 
  972.   void SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *cctx, SSL_CTX *ctx)
  973.   {
  974. >     cctx->ctx = ctx;
  975.       cctx->ssl = NULL;
  976.       if (ctx) {

ssl/ssl_conf.c:975:5: 
  973.   {
  974.       cctx->ctx = ctx;
  975. >     cctx->ssl = NULL;
  976.       if (ctx) {
  977.           cctx->poptions = &ctx->options;

ssl/ssl_conf.c:976:9: Taking true branch
  974.       cctx->ctx = ctx;
  975.       cctx->ssl = NULL;
  976.       if (ctx) {
                 ^
  977.           cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;

ssl/ssl_conf.c:977:9: 
  975.       cctx->ssl = NULL;
  976.       if (ctx) {
  977. >         cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;
  979.           cctx->max_version = &ctx->max_proto_version;

ssl/ssl_conf.c:978:9: 
  976.       if (ctx) {
  977.           cctx->poptions = &ctx->options;
  978. >         cctx->min_version = &ctx->min_proto_version;
  979.           cctx->max_version = &ctx->max_proto_version;
  980.           cctx->pcert_flags = &ctx->cert->cert_flags;

ssl/ssl_conf.c:979:9: 
  977.           cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;
  979. >         cctx->max_version = &ctx->max_proto_version;
  980.           cctx->pcert_flags = &ctx->cert->cert_flags;
  981.           cctx->pvfy_flags = &ctx->verify_mode;

ssl/ssl_conf.c:980:9: 
  978.           cctx->min_version = &ctx->min_proto_version;
  979.           cctx->max_version = &ctx->max_proto_version;
  980. >         cctx->pcert_flags = &ctx->cert->cert_flags;
  981.           cctx->pvfy_flags = &ctx->verify_mode;
  982.       } else {

ssl/ssl_conf.c:981:9: 
  979.           cctx->max_version = &ctx->max_proto_version;
  980.           cctx->pcert_flags = &ctx->cert->cert_flags;
  981. >         cctx->pvfy_flags = &ctx->verify_mode;
  982.       } else {
  983.           cctx->poptions = NULL;

ssl/ssl_conf.c:976:5: 
  974.       cctx->ctx = ctx;
  975.       cctx->ssl = NULL;
  976. >     if (ctx) {
  977.           cctx->poptions = &ctx->options;
  978.           cctx->min_version = &ctx->min_proto_version;

ssl/ssl_conf.c:989:1: return from a call to SSL_CONF_CTX_set_ssl_ctx
  987.           cctx->pvfy_flags = NULL;
  988.       }
  989. > }

test/sslapitest.c:2579:18: Skipping SSL_CONF_cmd(): empty list of specs
2577.                                               | SSL_CONF_FLAG_SERVER);
2578.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2579.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2580.                                2)) {
2581.                   SSL_CONF_CTX_free(confctx);

test/testutil/tests.c:209:1: start of procedure test_int_eq()
  207.       DEFINE_COMPARISON(type, name, ge, >=, fmt)
  208.   
  209. > DEFINE_COMPARISONS(int, int, "%d")
  210.   DEFINE_COMPARISONS(unsigned int, uint, "%u")
  211.   DEFINE_COMPARISONS(char, char, "%c")

test/testutil/tests.c:209:1: Taking false branch
  207.       DEFINE_COMPARISON(type, name, ge, >=, fmt)
  208.   
  209. > DEFINE_COMPARISONS(int, int, "%d")
  210.   DEFINE_COMPARISONS(unsigned int, uint, "%u")
  211.   DEFINE_COMPARISONS(char, char, "%c")

test/testutil/tests.c:209:1: return from a call to test_int_eq
  207.       DEFINE_COMPARISON(type, name, ge, >=, fmt)
  208.   
  209. > DEFINE_COMPARISONS(int, int, "%d")
  210.   DEFINE_COMPARISONS(unsigned int, uint, "%u")
  211.   DEFINE_COMPARISONS(char, char, "%c")

test/sslapitest.c:2579:18: Taking true branch
2577.                                               | SSL_CONF_FLAG_SERVER);
2578.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2579.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2580.                                2)) {
2581.                   SSL_CONF_CTX_free(confctx);

test/sslapitest.c:2581:17: Skipping SSL_CONF_CTX_free(): empty list of specs
2579.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2580.                                2)) {
2581.                   SSL_CONF_CTX_free(confctx);
                        ^
2582.                   goto end;
2583.               }
