ssl/ssl_ciph.c:468: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 463, column 16 is not reachable after line 468, column 13.
Showing all 44 steps of the trace


ssl/ssl_ciph.c:454:1: start of procedure do_load_builtin_compressions()
452.   }
453.   
454. > DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)
455.   {
456.       SSL_COMP *comp = NULL;

ssl/ssl_ciph.c:456:5: 
454.   DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)
455.   {
456. >     SSL_COMP *comp = NULL;
457.       COMP_METHOD *method = COMP_zlib();
458.   

ssl/ssl_ciph.c:457:5: 
455.   {
456.       SSL_COMP *comp = NULL;
457. >     COMP_METHOD *method = COMP_zlib();
458.   
459.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);

crypto/comp/c_zlib.c:209:1: start of procedure COMP_zlib()
  207.   #endif
  208.   
  209. > COMP_METHOD *COMP_zlib(void)
  210.   {
  211.       COMP_METHOD *meth = &zlib_method_nozlib;

crypto/comp/c_zlib.c:211:5: 
  209.   COMP_METHOD *COMP_zlib(void)
  210.   {
  211. >     COMP_METHOD *meth = &zlib_method_nozlib;
  212.   
  213.   #ifdef ZLIB_SHARED

crypto/comp/c_zlib.c:259:5: 
  257.   #endif
  258.   
  259. >     return (meth);
  260.   }
  261.   

crypto/comp/c_zlib.c:260:1: return from a call to COMP_zlib
  258.   
  259.       return (meth);
  260. > }
  261.   
  262.   void comp_zlib_cleanup_int(void)

ssl/ssl_ciph.c:459:5: 
457.       COMP_METHOD *method = COMP_zlib();
458.   
459. >     CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
460.       ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
461.   

crypto/mem_dbg.c:117:1: start of procedure CRYPTO_mem_ctrl()
  115.   #endif
  116.   
  117. > int CRYPTO_mem_ctrl(int mode)
  118.   {
  119.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem_dbg.c:120:5: 
  118.   {
  119.   #ifdef OPENSSL_NO_CRYPTO_MDEBUG
  120. >     return mode - mode;
  121.   #else
  122.       int ret = mh_mode;

crypto/mem_dbg.c:188:1: return from a call to CRYPTO_mem_ctrl
  186.       return ret;
  187.   #endif
  188. > }
  189.   
  190.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

ssl/ssl_ciph.c:460:5: 
458.   
459.       CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
460. >     ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
461.   
462.       if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {

include/openssl/ssl.h:904:1: start of procedure sk_SSL_COMP_new()
  902.    */
  903.   DEFINE_STACK_OF_CONST(SSL_CIPHER)
  904. > DEFINE_STACK_OF(SSL_COMP)
  905.   
  906.   /* compatibility */

include/openssl/ssl.h:904:1: return from a call to sk_SSL_COMP_new
  902.    */
  903.   DEFINE_STACK_OF_CONST(SSL_CIPHER)
  904. > DEFINE_STACK_OF(SSL_COMP)
  905.   
  906.   /* compatibility */

ssl/ssl_ciph.c:462:9: 
460.       ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
461.   
462. >     if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
463.           comp = OPENSSL_malloc(sizeof(*comp));
464.           if (comp != NULL) {

crypto/comp/comp_lib.c:36:1: start of procedure COMP_get_type()
  34.   }
  35.   
  36. > int COMP_get_type(const COMP_METHOD *meth)
  37.   {
  38.       return meth->type;

crypto/comp/comp_lib.c:38:5: 
  36.   int COMP_get_type(const COMP_METHOD *meth)
  37.   {
  38. >     return meth->type;
  39.   }
  40.   

crypto/comp/comp_lib.c:39:1: return from a call to COMP_get_type
  37.   {
  38.       return meth->type;
  39. > }
  40.   
  41.   const char *COMP_get_name(const COMP_METHOD *meth)

ssl/ssl_ciph.c:462:9: Taking true branch
460.       ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
461.   
462.       if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
               ^
463.           comp = OPENSSL_malloc(sizeof(*comp));
464.           if (comp != NULL) {

ssl/ssl_ciph.c:462:47: Taking true branch
460.       ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
461.   
462.       if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
                                                     ^
463.           comp = OPENSSL_malloc(sizeof(*comp));
464.           if (comp != NULL) {

ssl/ssl_ciph.c:463:9: 
461.   
462.       if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
463. >         comp = OPENSSL_malloc(sizeof(*comp));
464.           if (comp != NULL) {
465.               comp->method = method;

crypto/mem.c:170:1: start of procedure CRYPTO_malloc()
  168.   #endif
  169.   
  170. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  171.   {
  172.       void *ret = NULL;

crypto/mem.c:172:5: 
  170.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  171.   {
  172. >     void *ret = NULL;
  173.   
  174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:174:9: Taking false branch
  172.       void *ret = NULL;
  173.   
  174.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  175.           return malloc_impl(num, file, line);
  176.   

crypto/mem.c:177:9: Taking false branch
  175.           return malloc_impl(num, file, line);
  176.   
  177.       if (num == 0)
                 ^
  178.           return NULL;
  179.   

crypto/mem.c:181:5: 
  179.   
  180.       FAILTEST();
  181. >     allow_customize = 0;
  182.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  183.       if (call_malloc_debug) {

crypto/mem.c:191:5: 
  189.       }
  190.   #else
  191. >     (void)(file); (void)(line);
  192.       ret = malloc(num);
  193.   #endif

crypto/mem.c:191:19: 
  189.       }
  190.   #else
  191. >     (void)(file); (void)(line);
  192.       ret = malloc(num);
  193.   #endif

crypto/mem.c:192:5: 
  190.   #else
  191.       (void)(file); (void)(line);
  192. >     ret = malloc(num);
  193.   #endif
  194.   

crypto/mem.c:195:5: 
  193.   #endif
  194.   
  195. >     return ret;
  196.   }
  197.   

crypto/mem.c:196:1: return from a call to CRYPTO_malloc
  194.   
  195.       return ret;
  196. > }
  197.   
  198.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

ssl/ssl_ciph.c:464:13: Taking true branch
462.       if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
463.           comp = OPENSSL_malloc(sizeof(*comp));
464.           if (comp != NULL) {
                   ^
465.               comp->method = method;
466.               comp->id = SSL_COMP_ZLIB_IDX;

ssl/ssl_ciph.c:465:13: 
463.           comp = OPENSSL_malloc(sizeof(*comp));
464.           if (comp != NULL) {
465. >             comp->method = method;
466.               comp->id = SSL_COMP_ZLIB_IDX;
467.               comp->name = COMP_get_name(method);

ssl/ssl_ciph.c:466:13: 
464.           if (comp != NULL) {
465.               comp->method = method;
466. >             comp->id = SSL_COMP_ZLIB_IDX;
467.               comp->name = COMP_get_name(method);
468.               sk_SSL_COMP_push(ssl_comp_methods, comp);

ssl/ssl_ciph.c:467:13: 
465.               comp->method = method;
466.               comp->id = SSL_COMP_ZLIB_IDX;
467. >             comp->name = COMP_get_name(method);
468.               sk_SSL_COMP_push(ssl_comp_methods, comp);
469.               sk_SSL_COMP_sort(ssl_comp_methods);

crypto/comp/comp_lib.c:41:1: start of procedure COMP_get_name()
  39.   }
  40.   
  41. > const char *COMP_get_name(const COMP_METHOD *meth)
  42.   {
  43.       return meth->name;

crypto/comp/comp_lib.c:43:5: 
  41.   const char *COMP_get_name(const COMP_METHOD *meth)
  42.   {
  43. >     return meth->name;
  44.   }
  45.   

crypto/comp/comp_lib.c:44:1: return from a call to COMP_get_name
  42.   {
  43.       return meth->name;
  44. > }
  45.   
  46.   void COMP_CTX_free(COMP_CTX *ctx)

ssl/ssl_ciph.c:468:13: 
466.               comp->id = SSL_COMP_ZLIB_IDX;
467.               comp->name = COMP_get_name(method);
468. >             sk_SSL_COMP_push(ssl_comp_methods, comp);
469.               sk_SSL_COMP_sort(ssl_comp_methods);
470.           }

include/openssl/ssl.h:904:1: start of procedure sk_SSL_COMP_push()
  902.    */
  903.   DEFINE_STACK_OF_CONST(SSL_CIPHER)
  904. > DEFINE_STACK_OF(SSL_COMP)
  905.   
  906.   /* compatibility */

crypto/stack/stack.c:219:1: start of procedure OPENSSL_sk_push()
    217.   }
    218.   
    219. > int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    220.   {
    221.       return (OPENSSL_sk_insert(st, data, st->num));

crypto/stack/stack.c:221:5: Skipping OPENSSL_sk_insert(): empty list of specs
    219.   int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)
    220.   {
    221.       return (OPENSSL_sk_insert(st, data, st->num));
               ^
    222.   }
    223.   

crypto/stack/stack.c:222:1: return from a call to OPENSSL_sk_push
    220.   {
    221.       return (OPENSSL_sk_insert(st, data, st->num));
    222. > }
    223.   
    224.   int OPENSSL_sk_unshift(OPENSSL_STACK *st, const void *data)

include/openssl/ssl.h:904:1: return from a call to sk_SSL_COMP_push
  902.    */
  903.   DEFINE_STACK_OF_CONST(SSL_CIPHER)
  904. > DEFINE_STACK_OF(SSL_COMP)
  905.   
  906.   /* compatibility */

DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)
{
    SSL_COMP *comp = NULL;
    COMP_METHOD *method = COMP_zlib();
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
    ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);
    if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {
        comp = OPENSSL_malloc(sizeof(*comp));
        if (comp != NULL) {
            comp->method = method;
            comp->id = SSL_COMP_ZLIB_IDX;
            comp->name = COMP_get_name(method);
            sk_SSL_COMP_push(ssl_comp_methods, comp);
            sk_SSL_COMP_sort(ssl_comp_methods);
        }
    }
    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
    return 1;
}
['DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)', 'DEFINE_RUN_ONCE_STATIC(do_load_builtin_compressions)\n{\n    SSL_COMP *comp = NULL;\n    COMP_METHOD *method = COMP_zlib();\n    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);\n    ssl_comp_methods = sk_SSL_COMP_new(sk_comp_cmp);\n    if (COMP_get_type(method) != NID_undef && ssl_comp_methods != NULL) {\n        comp = OPENSSL_malloc(sizeof(*comp));\n        if (comp != NULL) {\n            comp->method = method;\n            comp->id = SSL_COMP_ZLIB_IDX;\n            comp->name = COMP_get_name(method);\n            sk_SSL_COMP_push(ssl_comp_methods, comp);\n            sk_SSL_COMP_sort(ssl_comp_methods);\n        }\n    }\n    CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);\n    return 1;\n}', 'COMP_METHOD *COMP_zlib(void)\n{\n    COMP_METHOD *meth = &zlib_method_nozlib;\n#ifdef ZLIB_SHARED\n# ifndef LIBZ\n#  if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32)\n#   define LIBZ "ZLIB1"\n#  elif defined(OPENSSL_SYS_VMS)\n#   define LIBZ "LIBZ"\n#  else\n#   define LIBZ "z"\n#  endif\n# endif\n    if (!zlib_loaded) {\n        zlib_dso = DSO_load(NULL, LIBZ, NULL, 0);\n        if (zlib_dso != NULL) {\n            p_compress = (compress_ft) DSO_bind_func(zlib_dso, "compress");\n            p_inflateEnd\n                = (inflateEnd_ft) DSO_bind_func(zlib_dso, "inflateEnd");\n            p_inflate = (inflate_ft) DSO_bind_func(zlib_dso, "inflate");\n            p_inflateInit_\n                = (inflateInit__ft) DSO_bind_func(zlib_dso, "inflateInit_");\n            p_deflateEnd\n                = (deflateEnd_ft) DSO_bind_func(zlib_dso, "deflateEnd");\n            p_deflate = (deflate_ft) DSO_bind_func(zlib_dso, "deflate");\n            p_deflateInit_\n                = (deflateInit__ft) DSO_bind_func(zlib_dso, "deflateInit_");\n            p_zError = (zError__ft) DSO_bind_func(zlib_dso, "zError");\n            if (p_compress && p_inflateEnd && p_inflate\n                && p_inflateInit_ && p_deflateEnd\n                && p_deflate && p_deflateInit_ && p_zError)\n                zlib_loaded++;\n            if (!OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL)) {\n                comp_zlib_cleanup_int();\n                return meth;\n            }\n            if (zlib_loaded)\n                meth = &zlib_stateful_method;\n        }\n    }\n#endif\n#if defined(ZLIB)\n    meth = &zlib_stateful_method;\n#endif\n    return (meth);\n}', 'int CRYPTO_mem_ctrl(int mode)\n{\n#ifdef OPENSSL_NO_CRYPTO_MDEBUG\n    return mode - mode;\n#else\n    int ret = mh_mode;\n    if (!RUN_ONCE(&memdbg_init, do_memdbg_init))\n        return -1;\n    CRYPTO_THREAD_write_lock(malloc_lock);\n    switch (mode) {\n    default:\n        break;\n    case CRYPTO_MEM_CHECK_ON:\n        mh_mode = CRYPTO_MEM_CHECK_ON | CRYPTO_MEM_CHECK_ENABLE;\n        num_disable = 0;\n        break;\n    case CRYPTO_MEM_CHECK_OFF:\n        mh_mode = 0;\n        num_disable = 0;\n        break;\n    case CRYPTO_MEM_CHECK_DISABLE:\n        if (mh_mode & CRYPTO_MEM_CHECK_ON) {\n            CRYPTO_THREAD_ID cur = CRYPTO_THREAD_get_current_id();\n            if (!num_disable\n                || !CRYPTO_THREAD_compare_id(disabling_threadid, cur)) {\n                CRYPTO_THREAD_unlock(malloc_lock);\n                CRYPTO_THREAD_write_lock(long_malloc_lock);\n                CRYPTO_THREAD_write_lock(malloc_lock);\n                mh_mode &= ~CRYPTO_MEM_CHECK_ENABLE;\n                disabling_threadid = cur;\n            }\n            num_disable++;\n        }\n        break;\n    case CRYPTO_MEM_CHECK_ENABLE:\n        if (mh_mode & CRYPTO_MEM_CHECK_ON) {\n            if (num_disable) {\n                num_disable--;\n                if (num_disable == 0) {\n                    mh_mode |= CRYPTO_MEM_CHECK_ENABLE;\n                    CRYPTO_THREAD_unlock(long_malloc_lock);\n                }\n            }\n        }\n        break;\n    }\n    CRYPTO_THREAD_unlock(malloc_lock);\n    return ret;\n#endif\n}', 'int COMP_get_type(const COMP_METHOD *meth)\n{\n    return meth->type;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num == 0)\n        return NULL;\n    FAILTEST();\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)(file); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'const char *COMP_get_name(const COMP_METHOD *meth)\n{\n    return meth->name;\n}', 'int OPENSSL_sk_push(OPENSSL_STACK *st, const void *data)\n{\n    return (OPENSSL_sk_insert(st, data, st->num));\n}']