ssl/record/ssl3_buffer.c:129: error: MEMORY_LEAK
  memory dynamically allocated by call to `ssl3_setup_read_buffer()` at line 127, column 10 is not reachable after line 129, column 10.
Showing all 31 steps of the trace


ssl/record/ssl3_buffer.c:125:1: start of procedure ssl3_setup_buffers()
123.   }
124.   
125. > int ssl3_setup_buffers(SSL *s)
126.   {
127.       if (!ssl3_setup_read_buffer(s))

ssl/record/ssl3_buffer.c:127:10: 
125.   int ssl3_setup_buffers(SSL *s)
126.   {
127. >     if (!ssl3_setup_read_buffer(s))
128.           return 0;
129.       if (!ssl3_setup_write_buffer(s, 1, 0))

ssl/record/ssl3_buffer.c:37:1: start of procedure ssl3_setup_read_buffer()
  35.   }
  36.   
  37. > int ssl3_setup_read_buffer(SSL *s)
  38.   {
  39.       unsigned char *p;

ssl/record/ssl3_buffer.c:40:5: 
  38.   {
  39.       unsigned char *p;
  40. >     size_t len, align = 0, headerlen;
  41.       SSL3_BUFFER *b;
  42.   

ssl/record/ssl3_buffer.c:43:5: 
  41.       SSL3_BUFFER *b;
  42.   
  43. >     b = RECORD_LAYER_get_rbuf(&s->rlayer);
  44.   
  45.       if (SSL_IS_DTLS(s))

ssl/record/ssl3_buffer.c:45:9: Taking true branch
  43.       b = RECORD_LAYER_get_rbuf(&s->rlayer);
  44.   
  45.       if (SSL_IS_DTLS(s))
                ^
  46.           headerlen = DTLS1_RT_HEADER_LENGTH;
  47.       else

ssl/record/ssl3_buffer.c:46:9: 
  44.   
  45.       if (SSL_IS_DTLS(s))
  46. >         headerlen = DTLS1_RT_HEADER_LENGTH;
  47.       else
  48.           headerlen = SSL3_RT_HEADER_LENGTH;

ssl/record/ssl3_buffer.c:51:5: 
  49.   
  50.   #if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0
  51. >     align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1);
  52.   #endif
  53.   

ssl/record/ssl3_buffer.c:54:9: Taking true branch
  52.   #endif
  53.   
  54.       if (b->buf == NULL) {
                ^
  55.           len = SSL3_RT_MAX_PLAIN_LENGTH
  56.               + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align;

ssl/record/ssl3_buffer.c:55:9: 
  53.   
  54.       if (b->buf == NULL) {
  55. >         len = SSL3_RT_MAX_PLAIN_LENGTH
  56.               + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align;
  57.   #ifndef OPENSSL_NO_COMP

ssl/record/ssl3_buffer.c:58:13: Taking false branch
  56.               + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align;
  57.   #ifndef OPENSSL_NO_COMP
  58.           if (ssl_allow_compression(s))
                    ^
  59.               len += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
  60.   #endif

ssl/record/ssl3_buffer.c:61:13: Taking false branch
  59.               len += SSL3_RT_MAX_COMPRESSED_OVERHEAD;
  60.   #endif
  61.           if (b->default_len > len)
                    ^
  62.               len = b->default_len;
  63.           if ((p = OPENSSL_malloc(len)) == NULL)

ssl/record/ssl3_buffer.c:63:13: 
  61.           if (b->default_len > len)
  62.               len = b->default_len;
  63. >         if ((p = OPENSSL_malloc(len)) == NULL)
  64.               goto err;
  65.           b->buf = p;

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)

ssl/record/ssl3_buffer.c:63:13: Taking false branch
  61.           if (b->default_len > len)
  62.               len = b->default_len;
  63.           if ((p = OPENSSL_malloc(len)) == NULL)
                    ^
  64.               goto err;
  65.           b->buf = p;

ssl/record/ssl3_buffer.c:65:9: 
  63.           if ((p = OPENSSL_malloc(len)) == NULL)
  64.               goto err;
  65. >         b->buf = p;
  66.           b->len = len;
  67.       }

ssl/record/ssl3_buffer.c:66:9: 
  64.               goto err;
  65.           b->buf = p;
  66. >         b->len = len;
  67.       }
  68.   

ssl/record/ssl3_buffer.c:69:5: 
  67.       }
  68.   
  69. >     RECORD_LAYER_set_packet(&s->rlayer, &(b->buf[0]));
  70.       return 1;
  71.   

ssl/record/ssl3_buffer.c:70:5: 
  68.   
  69.       RECORD_LAYER_set_packet(&s->rlayer, &(b->buf[0]));
  70. >     return 1;
  71.   
  72.    err:

ssl/record/ssl3_buffer.c:75:1: return from a call to ssl3_setup_read_buffer
  73.       SSLerr(SSL_F_SSL3_SETUP_READ_BUFFER, ERR_R_MALLOC_FAILURE);
  74.       return 0;
  75. > }
  76.   
  77.   int ssl3_setup_write_buffer(SSL *s, size_t numwpipes, size_t len)

ssl/record/ssl3_buffer.c:127:10: Taking false branch
125.   int ssl3_setup_buffers(SSL *s)
126.   {
127.       if (!ssl3_setup_read_buffer(s))
                ^
128.           return 0;
129.       if (!ssl3_setup_write_buffer(s, 1, 0))

ssl/record/ssl3_buffer.c:129:10: Skipping ssl3_setup_write_buffer(): empty list of specs
127.       if (!ssl3_setup_read_buffer(s))
128.           return 0;
129.       if (!ssl3_setup_write_buffer(s, 1, 0))
                ^
130.           return 0;
131.       return 1;

int ssl3_setup_buffers(SSL *s)
{
    if (!ssl3_setup_read_buffer(s))
        return 0;
    if (!ssl3_setup_write_buffer(s, 1, 0))
        return 0;
    return 1;
}
['int ssl3_setup_buffers(SSL *s)\n{\n    if (!ssl3_setup_read_buffer(s))\n        return 0;\n    if (!ssl3_setup_write_buffer(s, 1, 0))\n        return 0;\n    return 1;\n}', 'int ssl3_setup_read_buffer(SSL *s)\n{\n    unsigned char *p;\n    size_t len, align = 0, headerlen;\n    SSL3_BUFFER *b;\n    b = RECORD_LAYER_get_rbuf(&s->rlayer);\n    if (SSL_IS_DTLS(s))\n        headerlen = DTLS1_RT_HEADER_LENGTH;\n    else\n        headerlen = SSL3_RT_HEADER_LENGTH;\n#if defined(SSL3_ALIGN_PAYLOAD) && SSL3_ALIGN_PAYLOAD!=0\n    align = (-SSL3_RT_HEADER_LENGTH) & (SSL3_ALIGN_PAYLOAD - 1);\n#endif\n    if (b->buf == NULL) {\n        len = SSL3_RT_MAX_PLAIN_LENGTH\n            + SSL3_RT_MAX_ENCRYPTED_OVERHEAD + headerlen + align;\n#ifndef OPENSSL_NO_COMP\n        if (ssl_allow_compression(s))\n            len += SSL3_RT_MAX_COMPRESSED_OVERHEAD;\n#endif\n        if (b->default_len > len)\n            len = b->default_len;\n        if ((p = OPENSSL_malloc(len)) == NULL)\n            goto err;\n        b->buf = p;\n        b->len = len;\n    }\n    RECORD_LAYER_set_packet(&s->rlayer, &(b->buf[0]));\n    return 1;\n err:\n    SSLerr(SSL_F_SSL3_SETUP_READ_BUFFER, ERR_R_MALLOC_FAILURE);\n    return 0;\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}']