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


ssl/s3_lib.c:2994:1: start of procedure ssl3_new()
2992.   }
2993.   
2994. > int ssl3_new(SSL *s)
2995.   {
2996.       SSL3_STATE *s3;

ssl/s3_lib.c:2998:9: 
2996.       SSL3_STATE *s3;
2997.   
2998. >     if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
2999.           goto err;
3000.       s->s3 = s3;

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

crypto/mem.c:160:5: 
  158.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  159.   {
  160. >     void *ret = CRYPTO_malloc(num, file, line);
  161.   
  162.       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 (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    124.           return malloc_impl(num, file, line);
    125.   

crypto/mem.c:126:9: Taking false branch
    124.           return malloc_impl(num, file, line);
    125.   
    126.       if (num <= 0)
                   ^
    127.           return NULL;
    128.   

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

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

crypto/mem.c:139:24: 
    137.       }
    138.   #else
    139. >     osslargused(file); osslargused(line);
    140.       ret = malloc(num);
    141.   #endif

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

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

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

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

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

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

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

ssl/s3_lib.c:2998:9: Taking false branch
2996.       SSL3_STATE *s3;
2997.   
2998.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
                ^
2999.           goto err;
3000.       s->s3 = s3;

ssl/s3_lib.c:3000:5: 
2998.       if ((s3 = OPENSSL_zalloc(sizeof(*s3))) == NULL)
2999.           goto err;
3000. >     s->s3 = s3;
3001.   
3002.   #ifndef OPENSSL_NO_SRP

ssl/s3_lib.c:3003:10: Skipping SSL_SRP_CTX_init(): empty list of specs
3001.   
3002.   #ifndef OPENSSL_NO_SRP
3003.       if (!SSL_SRP_CTX_init(s))
                 ^
3004.             goto err;
3005.   #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#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}']