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


ssl/s3_lib.c:3353:1: start of procedure ssl3_new()
3351.   }
3352.   
3353. > int ssl3_new(SSL *s)
3354.   {
3355.       SSL3_STATE *s3;

ssl/s3_lib.c:3357:9: 
3355.       SSL3_STATE *s3;
3356.   
3357. >     if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3358.           goto err;
3359.       s->s3 = s3;

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

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

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
    118.   }
    119.   
    120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122.       void *ret = NULL;

crypto/mem.c:122:5: 
    120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    121.   {
    122. >     void *ret = NULL;
    123.   
    124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
    122.       void *ret = NULL;
    123.   
    124.       if (num <= 0)
                   ^
    125.           return NULL;
    126.   

crypto/mem.c:127:5: 
    125.           return NULL;
    126.   
    127. >     allow_customize = 0;
    128.   #ifdef CRYPTO_MDEBUG
    129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
    135.       }
    136.   #else
    137. >     (void)file;
    138.       (void)line;
    139.       ret = malloc(num);

crypto/mem.c:138:5: 
    136.   #else
    137.       (void)file;
    138. >     (void)line;
    139.       ret = malloc(num);
    140.   #endif

crypto/mem.c:139:5: 
    137.       (void)file;
    138.       (void)line;
    139. >     ret = malloc(num);
    140.   #endif
    141.   

crypto/mem.c:154:5: 
    152.   #endif
    153.   
    154. >     return ret;
    155.   }
    156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
    153.   
    154.       return ret;
    155. > }
    156.   
    157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:161:9: Taking true branch
  159.       void *ret = CRYPTO_malloc(num, file, line);
  160.   
  161.       if (ret != NULL)
                 ^
  162.           memset(ret, 0, num);
  163.       return ret;

crypto/mem.c:162:9: 
  160.   
  161.       if (ret != NULL)
  162. >         memset(ret, 0, num);
  163.       return ret;
  164.   }

crypto/mem.c:163:5: 
  161.       if (ret != NULL)
  162.           memset(ret, 0, num);
  163. >     return ret;
  164.   }
  165.   

crypto/mem.c:164:1: return from a call to CRYPTO_zalloc
  162.           memset(ret, 0, num);
  163.       return ret;
  164. > }
  165.   
  166.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

ssl/s3_lib.c:3357:9: Taking false branch
3355.       SSL3_STATE *s3;
3356.   
3357.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
                ^
3358.           goto err;
3359.       s->s3 = s3;

ssl/s3_lib.c:3359:5: 
3357.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3358.           goto err;
3359. >     s->s3 = s3;
3360.   
3361.   #ifndef OPENSSL_NO_SRP

ssl/s3_lib.c:3362:10: Skipping SSL_SRP_CTX_init(): empty list of specs
3360.   
3361.   #ifndef OPENSSL_NO_SRP
3362.       if (!SSL_SRP_CTX_init(s))
                 ^
3363.             goto err;
3364.   #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 (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifdef 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;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}']