ssl/s3_lib.c:2821: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_zalloc()` at line 2816, column 15 is not reachable after line 2821, column 10.
Showing all 21 steps of the trace


ssl/s3_lib.c:2812:1: start of procedure ssl3_new()
2810.   }
2811.   
2812. > int ssl3_new(SSL *s)
2813.   {
2814.       SSL3_STATE *s3;

ssl/s3_lib.c:2816:9: 
2814.       SSL3_STATE *s3;
2815.   
2816. >     if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
2817.           goto err;
2818.       s->s3 = s3;

crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
  96.   }
  97.   
  98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100. >     void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
    69.   }
    70.   
    71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73.       void *ret = NULL;

crypto/mem.c:73:5: 
    71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    72.   {
    73. >     void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
    73.       void *ret = NULL;
    74.   
    75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                  ^
    76.           return malloc_impl(num, file, line);
    77.   

crypto/mem.c:78:9: Taking false branch
    76.           return malloc_impl(num, file, line);
    77.   
    78.       if (num <= 0)
                  ^
    79.           return NULL;
    80.   

crypto/mem.c:81:5: 
    79.           return NULL;
    80.   
    81. >     allow_customize = 0;
    82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:91:24: 
    89.       }
    90.   #else
    91. >     osslargused(file); osslargused(line);
    92.       ret = malloc(num);
    93.   #endif

crypto/mem.c:92:5: 
    90.   #else
    91.       osslargused(file); osslargused(line);
    92. >     ret = malloc(num);
    93.   #endif
    94.   

crypto/mem.c:95:5: 
    93.   #endif
    94.   
    95. >     return ret;
    96.   }
    97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
    94.   
    95.       return ret;
    96. > }
    97.   
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:102:9: Taking true branch
  100.       void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)
                 ^
  103.           memset(ret, 0, num);
  104.       return ret;

crypto/mem.c:103:9: 
  101.   
  102.       if (ret != NULL)
  103. >         memset(ret, 0, num);
  104.       return ret;
  105.   }

crypto/mem.c:104:5: 
  102.       if (ret != NULL)
  103.           memset(ret, 0, num);
  104. >     return ret;
  105.   }
  106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
  103.           memset(ret, 0, num);
  104.       return ret;
  105. > }
  106.   
  107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/s3_lib.c:2816:9: Taking false branch
2814.       SSL3_STATE *s3;
2815.   
2816.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
                ^
2817.           goto err;
2818.       s->s3 = s3;

ssl/s3_lib.c:2818:5: 
2816.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
2817.           goto err;
2818. >     s->s3 = s3;
2819.   
2820.   #ifndef OPENSSL_NO_SRP

ssl/s3_lib.c:2821:10: Skipping SSL_SRP_CTX_init(): empty list of specs
2819.   
2820.   #ifndef OPENSSL_NO_SRP
2821.       if (!SSL_SRP_CTX_init(s))
                 ^
2822.           goto err;
2823.   #endif

int ssl3_new(SSL *s)
{
    SSL3_STATE *s3;
    if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
        goto err;
    s->s3 = s3;
#ifndef OPENSSL_NO_SRP
    if (!SSL_SRP_CTX_init(s))
        goto err;
#endif
    s->method->ssl_clear(s);
    return (1);
 err:
    return (0);
}
['int ssl3_new(SSL *s)\n{\n    SSL3_STATE *s3;\n    if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)\n        goto err;\n    s->s3 = s3;\n#ifndef OPENSSL_NO_SRP\n    if (!SSL_SRP_CTX_init(s))\n        goto err;\n#endif\n    s->method->ssl_clear(s);\n    return (1);\n err:\n    return (0);\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\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    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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}']