crypto/ocsp/ocsp_ht.c:129: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 127, column 19 is not reachable after line 129, column 9.
Showing all 70 steps of the trace


crypto/ocsp/ocsp_ht.c:113:1: start of procedure OCSP_REQ_CTX_new()
111.   static int parse_http_line1(char *line);
112.   
113. > OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
114.   {
115.       OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));

crypto/ocsp/ocsp_ht.c:115:5: 
113.   OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
114.   {
115. >     OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
116.   
117.       if (rctx == NULL)

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
  144.   }
  145.   
  146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  147.   {
  148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
  146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  147.   {
  148. >     void *ret = CRYPTO_malloc(num, file, line);
  149.   
  150.       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:143:5: 
    141.   #endif
    142.   
    143. >     return ret;
    144.   }
    145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
    142.   
    143.       return ret;
    144. > }
    145.   
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:150:9: Taking true branch
  148.       void *ret = CRYPTO_malloc(num, file, line);
  149.   
  150.       if (ret != NULL)
                 ^
  151.           memset(ret, 0, num);
  152.       return ret;

crypto/mem.c:151:9: 
  149.   
  150.       if (ret != NULL)
  151. >         memset(ret, 0, num);
  152.       return ret;
  153.   }

crypto/mem.c:152:5: 
  150.       if (ret != NULL)
  151.           memset(ret, 0, num);
  152. >     return ret;
  153.   }
  154.   

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

crypto/ocsp/ocsp_ht.c:117:9: Taking false branch
115.       OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
116.   
117.       if (rctx == NULL)
               ^
118.           return NULL;
119.       rctx->state = OHS_ERROR;

crypto/ocsp/ocsp_ht.c:119:5: 
117.       if (rctx == NULL)
118.           return NULL;
119. >     rctx->state = OHS_ERROR;
120.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
121.       rctx->mem = BIO_new(BIO_s_mem());

crypto/ocsp/ocsp_ht.c:120:5: 
118.           return NULL;
119.       rctx->state = OHS_ERROR;
120. >     rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
121.       rctx->mem = BIO_new(BIO_s_mem());
122.       rctx->io = io;

crypto/ocsp/ocsp_ht.c:121:5: 
119.       rctx->state = OHS_ERROR;
120.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
121. >     rctx->mem = BIO_new(BIO_s_mem());
122.       rctx->io = io;
123.       if (maxline > 0)

crypto/bio/bss_mem.c:111:1: start of procedure BIO_s_mem()
  109.    */
  110.   
  111. > const BIO_METHOD *BIO_s_mem(void)
  112.   {
  113.       return (&mem_method);

crypto/bio/bss_mem.c:113:5: 
  111.   const BIO_METHOD *BIO_s_mem(void)
  112.   {
  113. >     return (&mem_method);
  114.   }
  115.   

crypto/bio/bss_mem.c:114:1: return from a call to BIO_s_mem
  112.   {
  113.       return (&mem_method);
  114. > }
  115.   
  116.   const BIO_METHOD *BIO_s_secmem(void)

crypto/bio/bio_lib.c:65:1: start of procedure BIO_new()
  63.   #include <openssl/stack.h>
  64.   
  65. > BIO *BIO_new(const BIO_METHOD *method)
  66.   {
  67.       BIO *ret = OPENSSL_malloc(sizeof(*ret));

crypto/bio/bio_lib.c:67:5: 
  65.   BIO *BIO_new(const BIO_METHOD *method)
  66.   {
  67. >     BIO *ret = OPENSSL_malloc(sizeof(*ret));
  68.   
  69.       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 true 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:123:32: Taking true 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:124:9: Skipping __function_pointer__(): unresolved function pointer
    122.   
    123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
    124.           return malloc_impl(num, file, line);
                   ^
    125.   
    126.       if (num <= 0)

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
    142.   
    143.       return ret;
    144. > }
    145.   
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/bio/bio_lib.c:69:9: Taking true branch
  67.       BIO *ret = OPENSSL_malloc(sizeof(*ret));
  68.   
  69.       if (ret == NULL) {
                ^
  70.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  71.           return (NULL);

crypto/bio/bio_lib.c:70:9: Skipping ERR_put_error(): empty list of specs
  68.   
  69.       if (ret == NULL) {
  70.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
                ^
  71.           return (NULL);
  72.       }

crypto/bio/bio_lib.c:71:9: 
  69.       if (ret == NULL) {
  70.           BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);
  71. >         return (NULL);
  72.       }
  73.       if (!BIO_set(ret, method)) {

crypto/bio/bio_lib.c:78:1: return from a call to BIO_new
  76.       }
  77.       return (ret);
  78. > }
  79.   
  80.   int BIO_set(BIO *bio, const BIO_METHOD *method)

crypto/ocsp/ocsp_ht.c:122:5: 
120.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
121.       rctx->mem = BIO_new(BIO_s_mem());
122. >     rctx->io = io;
123.       if (maxline > 0)
124.           rctx->iobuflen = maxline;

crypto/ocsp/ocsp_ht.c:123:9: Taking true branch
121.       rctx->mem = BIO_new(BIO_s_mem());
122.       rctx->io = io;
123.       if (maxline > 0)
               ^
124.           rctx->iobuflen = maxline;
125.       else

crypto/ocsp/ocsp_ht.c:124:9: 
122.       rctx->io = io;
123.       if (maxline > 0)
124. >         rctx->iobuflen = maxline;
125.       else
126.           rctx->iobuflen = OCSP_MAX_LINE_LEN;

crypto/ocsp/ocsp_ht.c:127:5: 
125.       else
126.           rctx->iobuflen = OCSP_MAX_LINE_LEN;
127. >     rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
128.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
129.           OCSP_REQ_CTX_free(rctx);

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:143:5: 
  141.   #endif
  142.   
  143. >     return ret;
  144.   }
  145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
  142.   
  143.       return ret;
  144. > }
  145.   
  146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:128:9: Taking false branch
126.           rctx->iobuflen = OCSP_MAX_LINE_LEN;
127.       rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
128.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
               ^
129.           OCSP_REQ_CTX_free(rctx);
130.           return NULL;

crypto/ocsp/ocsp_ht.c:128:32: Taking true branch
126.           rctx->iobuflen = OCSP_MAX_LINE_LEN;
127.       rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
128.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
                                      ^
129.           OCSP_REQ_CTX_free(rctx);
130.           return NULL;

crypto/ocsp/ocsp_ht.c:129:9: 
127.       rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
128.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
129. >         OCSP_REQ_CTX_free(rctx);
130.           return NULL;
131.       }

crypto/ocsp/ocsp_ht.c:135:1: start of procedure OCSP_REQ_CTX_free()
  133.   }
  134.   
  135. > void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
  136.   {
  137.       if (!rctx)

crypto/ocsp/ocsp_ht.c:137:10: Taking false branch
  135.   void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
  136.   {
  137.       if (!rctx)
                  ^
  138.           return;
  139.       BIO_free(rctx->mem);

crypto/ocsp/ocsp_ht.c:139:5: Skipping BIO_free(): empty list of specs
  137.       if (!rctx)
  138.           return;
  139.       BIO_free(rctx->mem);
             ^
  140.       OPENSSL_free(rctx->iobuf);
  141.       OPENSSL_free(rctx);

crypto/ocsp/ocsp_ht.c:140:5: 
  138.           return;
  139.       BIO_free(rctx->mem);
  140. >     OPENSSL_free(rctx->iobuf);
  141.       OPENSSL_free(rctx);
  142.   }

crypto/mem.c:210:1: start of procedure CRYPTO_free()
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:212:9: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:212:30: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:213:9: Skipping __function_pointer__(): unresolved function pointer
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
                   ^
    214.           return;
    215.       }

crypto/mem.c:214:9: 
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
    214. >         return;
    215.       }
    216.   

crypto/mem.c:228:1: return from a call to CRYPTO_free
    226.       free(str);
    227.   #endif
    228. > }
    229.   
    230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:141:5: 
  139.       BIO_free(rctx->mem);
  140.       OPENSSL_free(rctx->iobuf);
  141. >     OPENSSL_free(rctx);
  142.   }
  143.   

crypto/mem.c:210:1: start of procedure CRYPTO_free()
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:212:9: Taking false branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:226:5: 
    224.       }
    225.   #else
    226. >     free(str);
    227.   #endif
    228.   }

crypto/mem.c:228:1: return from a call to CRYPTO_free
    226.       free(str);
    227.   #endif
    228. > }
    229.   
    230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:142:1: return from a call to OCSP_REQ_CTX_free
  140.       OPENSSL_free(rctx->iobuf);
  141.       OPENSSL_free(rctx);
  142. > }
  143.   
  144.   BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx)

OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
{
    OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
    if (rctx == NULL)
        return NULL;
    rctx->state = OHS_ERROR;
    rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
    rctx->mem = BIO_new(BIO_s_mem());
    rctx->io = io;
    if (maxline > 0)
        rctx->iobuflen = maxline;
    else
        rctx->iobuflen = OCSP_MAX_LINE_LEN;
    rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
    if (rctx->iobuf == NULL || rctx->mem == NULL) {
        OCSP_REQ_CTX_free(rctx);
        return NULL;
    }
    return rctx;
}
['OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)\n{\n    OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));\n    if (rctx == NULL)\n        return NULL;\n    rctx->state = OHS_ERROR;\n    rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;\n    rctx->mem = BIO_new(BIO_s_mem());\n    rctx->io = io;\n    if (maxline > 0)\n        rctx->iobuflen = maxline;\n    else\n        rctx->iobuflen = OCSP_MAX_LINE_LEN;\n    rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);\n    if (rctx->iobuf == NULL || rctx->mem == NULL) {\n        OCSP_REQ_CTX_free(rctx);\n        return NULL;\n    }\n    return rctx;\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    return ret;\n}', 'const BIO_METHOD *BIO_s_mem(void)\n{\n    return (&mem_method);\n}', 'BIO *BIO_new(const BIO_METHOD *method)\n{\n    BIO *ret = OPENSSL_malloc(sizeof(*ret));\n    if (ret == NULL) {\n        BIOerr(BIO_F_BIO_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    if (!BIO_set(ret, method)) {\n        OPENSSL_free(ret);\n        ret = NULL;\n    }\n    return (ret);\n}', 'void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)\n{\n    if (!rctx)\n        return;\n    BIO_free(rctx->mem);\n    OPENSSL_free(rctx->iobuf);\n    OPENSSL_free(rctx);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}']