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


test/sslapitest.c:2289:1: start of procedure test_early_data_replay_int()
2287.    * confopt == 1: Configure anti-replay using SSL_CONF
2288.    */
2289. > static int test_early_data_replay_int(int idx, int usecb, int confopt)
2290.   {
2291.       SSL_CTX *cctx = NULL, *sctx = NULL;

test/sslapitest.c:2291:5: 
2289.   static int test_early_data_replay_int(int idx, int usecb, int confopt)
2290.   {
2291. >     SSL_CTX *cctx = NULL, *sctx = NULL;
2292.       SSL *clientssl = NULL, *serverssl = NULL;
2293.       int testresult = 0;

test/sslapitest.c:2292:5: 
2290.   {
2291.       SSL_CTX *cctx = NULL, *sctx = NULL;
2292. >     SSL *clientssl = NULL, *serverssl = NULL;
2293.       int testresult = 0;
2294.       SSL_SESSION *sess = NULL;

test/sslapitest.c:2293:5: 
2291.       SSL_CTX *cctx = NULL, *sctx = NULL;
2292.       SSL *clientssl = NULL, *serverssl = NULL;
2293. >     int testresult = 0;
2294.       SSL_SESSION *sess = NULL;
2295.       size_t readbytes, written;

test/sslapitest.c:2294:5: 
2292.       SSL *clientssl = NULL, *serverssl = NULL;
2293.       int testresult = 0;
2294. >     SSL_SESSION *sess = NULL;
2295.       size_t readbytes, written;
2296.       unsigned char buf[20];

test/sslapitest.c:2298:5: 
2296.       unsigned char buf[20];
2297.   
2298. >     allow_ed_cb_called = 0;
2299.   
2300.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),

test/sslapitest.c:2300:10: 
2298.       allow_ed_cb_called = 0;
2299.   
2300. >     if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
2301.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2302.                                          &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:2300:10: Condition is true
2298.       allow_ed_cb_called = 0;
2299.   
2300.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2301.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2302.                                          &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:2300:10: Taking false branch
2298.       allow_ed_cb_called = 0;
2299.   
2300.       if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(),
                 ^
2301.                                          TLS1_VERSION, TLS_MAX_VERSION, &sctx,
2302.                                          &cctx, cert, privkey)))

test/sslapitest.c:2305:9: Taking true branch
2303.           return 0;
2304.   
2305.       if (usecb > 0) {
                ^
2306.           if (confopt == 0) {
2307.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);

test/sslapitest.c:2306:13: Taking false branch
2304.   
2305.       if (usecb > 0) {
2306.           if (confopt == 0) {
                    ^
2307.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2308.           } else {

test/sslapitest.c:2309:13: 
2307.               SSL_CTX_set_options(sctx, SSL_OP_NO_ANTI_REPLAY);
2308.           } else {
2309. >             SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2310.   
2311.               if (!TEST_ptr(confctx))

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

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

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

test/sslapitest.c:2311:18: 
2309.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2310.   
2311. >             if (!TEST_ptr(confctx))
2312.                   goto end;
2313.               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:2311:18: Taking false branch
2309.               SSL_CONF_CTX *confctx = SSL_CONF_CTX_new();
2310.   
2311.               if (!TEST_ptr(confctx))
                         ^
2312.                   goto end;
2313.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE

test/sslapitest.c:2313:13: 
2311.               if (!TEST_ptr(confctx))
2312.                   goto end;
2313. >             SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2314.                                               | SSL_CONF_FLAG_SERVER);
2315.               SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);

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

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

ssl/ssl_conf.c:931:5: 
  929.   {
  930.       cctx->flags |= flags;
  931. >     return cctx->flags;
  932.   }
  933.   

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

test/sslapitest.c:2315:13: 
2313.               SSL_CONF_CTX_set_flags(confctx, SSL_CONF_FLAG_FILE
2314.                                               | SSL_CONF_FLAG_SERVER);
2315. >             SSL_CONF_CTX_set_ssl_ctx(confctx, sctx);
2316.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2317.                                2)) {

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

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

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

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

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

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

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

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

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

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

ssl/ssl_conf.c:993:1: return from a call to SSL_CONF_CTX_set_ssl_ctx
  991.           cctx->pvfy_flags = NULL;
  992.       }
  993. > }

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

test/sslapitest.c:2318:17: Skipping SSL_CONF_CTX_free(): empty list of specs
2316.               if (!TEST_int_eq(SSL_CONF_cmd(confctx, "Options", "-AntiReplay"),
2317.                                2)) {
2318.                   SSL_CONF_CTX_free(confctx);
                        ^
2319.                   goto end;
2320.               }
