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


ssl/s3_lib.c:2904:1: start of procedure ssl3_new()
2902.   }
2903.   
2904. > int ssl3_new(SSL *s)
2905.   {
2906.       SSL3_STATE *s3;

ssl/s3_lib.c:2908:9: 
2906.       SSL3_STATE *s3;
2907.   
2908. >     if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
2909.           goto err;
2910.       s->s3 = s3;

crypto/mem.c:186:1: start of procedure CRYPTO_zalloc()
  184.   }
  185.   
  186. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  187.   {
  188.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:188:5: 
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  187.   {
  188. >     void *ret = CRYPTO_malloc(num, file, line);
  189.   
  190.       FAILTEST();

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
    156.   #endif
    157.   
    158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160.       void *ret = NULL;

crypto/mem.c:160:5: 
    158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    159.   {
    160. >     void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking false branch
    160.       void *ret = NULL;
    161.   
    162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    163.           return malloc_impl(num, file, line);
    164.   

crypto/mem.c:165:9: Taking false branch
    163.           return malloc_impl(num, file, line);
    164.   
    165.       if (num == 0)
                   ^
    166.           return NULL;
    167.   

crypto/mem.c:169:5: 
    167.   
    168.       FAILTEST();
    169. >     allow_customize = 0;
    170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:179:24: 
    177.       }
    178.   #else
    179. >     osslargused(file); osslargused(line);
    180.       ret = malloc(num);
    181.   #endif

crypto/mem.c:180:5: 
    178.   #else
    179.       osslargused(file); osslargused(line);
    180. >     ret = malloc(num);
    181.   #endif
    182.   

crypto/mem.c:183:5: 
    181.   #endif
    182.   
    183. >     return ret;
    184.   }
    185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
    182.   
    183.       return ret;
    184. > }
    185.   
    186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:191:9: Taking true branch
  189.   
  190.       FAILTEST();
  191.       if (ret != NULL)
                 ^
  192.           memset(ret, 0, num);
  193.       return ret;

crypto/mem.c:192:9: 
  190.       FAILTEST();
  191.       if (ret != NULL)
  192. >         memset(ret, 0, num);
  193.       return ret;
  194.   }

crypto/mem.c:193:5: 
  191.       if (ret != NULL)
  192.           memset(ret, 0, num);
  193. >     return ret;
  194.   }
  195.   

crypto/mem.c:194:1: return from a call to CRYPTO_zalloc
  192.           memset(ret, 0, num);
  193.       return ret;
  194. > }
  195.   
  196.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/s3_lib.c:2908:9: Taking false branch
2906.       SSL3_STATE *s3;
2907.   
2908.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
                ^
2909.           goto err;
2910.       s->s3 = s3;

ssl/s3_lib.c:2910:5: 
2908.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
2909.           goto err;
2910. >     s->s3 = s3;
2911.   
2912.   #ifndef OPENSSL_NO_SRP

ssl/s3_lib.c:2913:10: Skipping SSL_SRP_CTX_init(): empty list of specs
2911.   
2912.   #ifndef OPENSSL_NO_SRP
2913.       if (!SSL_SRP_CTX_init(s))
                 ^
2914.           goto err;
2915.   #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
    if (!s->method->ssl_clear(s))
        return 0;
    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    if (!s->method->ssl_clear(s))\n        return 0;\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    FAILTEST();\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    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    osslargused(file); osslargused(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}']