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


ssl/s3_lib.c:3011:1: start of procedure ssl3_new()
3009.   }
3010.   
3011. > int ssl3_new(SSL *s)
3012.   {
3013.       SSL3_STATE *s3;

ssl/s3_lib.c:3015:9: 
3013.       SSL3_STATE *s3;
3014.   
3015. >     if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3016.           goto err;
3017.       s->s3 = s3;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ssl/s3_lib.c:3015:9: Taking false branch
3013.       SSL3_STATE *s3;
3014.   
3015.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
                ^
3016.           goto err;
3017.       s->s3 = s3;

ssl/s3_lib.c:3017:5: 
3015.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
3016.           goto err;
3017. >     s->s3 = s3;
3018.   
3019.   #ifndef OPENSSL_NO_SRP

ssl/s3_lib.c:3020:10: Skipping SSL_SRP_CTX_init(): empty list of specs
3018.   
3019.   #ifndef OPENSSL_NO_SRP
3020.       if (!SSL_SRP_CTX_init(s))
                 ^
3021.             goto err;
3022.   #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#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;\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}']