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


test/sslapitest.c:2706:1: start of procedure test_early_data_replay_int()
2704.    * confopt == 1: Configure anti-replay using SSL_CONF
2705.    */
2706. > static int test_early_data_replay_int(int idx, int usecb, int confopt)
2707.   {
2708.       SSL_CTX *cctx = NULL, *sctx = NULL;

test/sslapitest.c:2708:5: 
2706.   static int test_early_data_replay_int(int idx, int usecb, int confopt)
2707.   {
2708. >     SSL_CTX *cctx = NULL, *sctx = NULL;
2709.       SSL *clientssl = NULL, *serverssl = NULL;
2710.       int testresult = 0;

test/sslapitest.c:2709:5: 
2707.   {
2708.       SSL_CTX *cctx = NULL, *sctx = NULL;
2709. >     SSL *clientssl = NULL, *serverssl = NULL;
2710.       int testresult = 0;
2711.       SSL_SESSION *sess = NULL;

test/sslapitest.c:2710:5: 
2708.       SSL_CTX *cctx = NULL, *sctx = NULL;
2709.       SSL *clientssl = NULL, *serverssl = NULL;
2710. >     int testresult = 0;
2711.       SSL_SESSION *sess = NULL;
2712.       size_t readbytes, written;

test/sslapitest.c:2711:5: 
2709.       SSL *clientssl = NULL, *serverssl = NULL;
2710.       int testresult = 0;
2711. >     SSL_SESSION *sess = NULL;
2712.       size_t readbytes, written;
2713.       unsigned char buf[20];

test/sslapitest.c:2715:5: 
2713.       unsigned char buf[20];
2714.   
2715. >     allow_ed_cb_called = 0;
2716.   
2717.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),

test/sslapitest.c:2717:10: 
2715.       allow_ed_cb_called = 0;
2716.   
2717. >     if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
2718.                                          TLS1_VERSION, 0, &sctx,
2719.                                          &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:2717:10: Condition is true
2715.       allow_ed_cb_called = 0;
2716.   
2717.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2718.                                          TLS1_VERSION, 0, &sctx,
2719.                                          &cctx, cert, privkey)))

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

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

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

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

test/sslapitest.c:2717:10: Taking false branch
2715.       allow_ed_cb_called = 0;
2716.   
2717.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2718.                                          TLS1_VERSION, 0, &sctx,
2719.                                          &cctx, cert, privkey)))

test/sslapitest.c:2722:9: Taking true branch
2720.           return 0;
2721.   
2722.       if (usecb > 0) {
                ^
2723.           if (confopt == 0) {
2724.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);

test/sslapitest.c:2723:13: Taking false branch
2721.   
2722.       if (usecb > 0) {
2723.           if (confopt == 0) {
                    ^
2724.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2725.           } else {

test/sslapitest.c:2726:13: 
2724.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2725.           } else {
2726. >             SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2727.   
2728.               if (!TEST_ptr(confctx))

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

ssl/ssl_conf.c:875:5: 
  873.   SSL_CONF_CTX *SSL_CONF_CTX_new(void)
  874.   {
  875. >     SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  876.   
  877.       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:877:5: 
  875.       SSL_CONF_CTX *ret = OPENSSL_zalloc(sizeof(*ret));
  876.   
  877. >     return ret;
  878.   }
  879.   

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

test/sslapitest.c:2728:18: 
2726.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2727.   
2728. >             if (!TEST_ptr(confctx))
2729.                   goto end;
2730.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

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

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

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

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

test/sslapitest.c:2728:18: Taking false branch
2726.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2727.   
2728.               if (!TEST_ptr(confctx))
                         ^
2729.                   goto end;
2730.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

test/sslapitest.c:2730:13: 
2728.               if (!TEST_ptr(confctx))
2729.                   goto end;
2730. >             SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2731.                                               | SSL_CONF_FLAG_SERVER);
2732.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);

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

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

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

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

test/sslapitest.c:2732:13: 
2730.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2731.                                               | SSL_CONF_FLAG_SERVER);
2732. >             SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2733.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2734.                                2)) {

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

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

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

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

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

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

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

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

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

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

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

test/sslapitest.c:2733:18: Skipping SSL_CONF_cmd(): empty list of specs
2731.                                               | SSL_CONF_FLAG_SERVER);
2732.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2733.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2734.                                2)) {
2735.                   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:2733:18: Taking true branch
2731.                                               | SSL_CONF_FLAG_SERVER);
2732.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2733.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
                         ^
2734.                                2)) {
2735.                   SSL_CONF_CTX_free(confctx);

test/sslapitest.c:2735:17: Skipping SSL_CONF_CTX_free(): empty list of specs
2733.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2734.                                2)) {
2735.                   SSL_CONF_CTX_free(confctx);
                        ^
2736.                   goto end;
2737.               }
