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


crypto/ocsp/ocsp_ht.c:64:1: start of procedure OCSP_REQ_CTX_new()
62.   static int parse_http_line1(char *line);
63.   
64. > OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
65.   {
66.       OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));

crypto/ocsp/ocsp_ht.c:66:5: 
64.   OCSP_REQ_CTX *OCSP_REQ_CTX_new(BIO *io, int maxline)
65.   {
66. >     OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
67.   
68.       if (rctx == NULL)

crypto/mem.c:197:1: start of procedure CRYPTO_zalloc()
  195.   }
  196.   
  197. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  198.   {
  199.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:199:5: 
  197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  198.   {
  199. >     void *ret = CRYPTO_malloc(num, file, line);
  200.   
  201.       FAILTEST();

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
    167.   #endif
    168.   
    169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    170.   {
    171.       void *ret = NULL;

crypto/mem.c:171:5: 
    169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    170.   {
    171. >     void *ret = NULL;
    172.   
    173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
    171.       void *ret = NULL;
    172.   
    173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    174.           return malloc_impl(num, file, line);
    175.   

crypto/mem.c:176:9: Taking false branch
    174.           return malloc_impl(num, file, line);
    175.   
    176.       if (num == 0)
                   ^
    177.           return NULL;
    178.   

crypto/mem.c:180:5: 
    178.   
    179.       FAILTEST();
    180. >     allow_customize = 0;
    181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
    188.       }
    189.   #else
    190. >     (void)(file); (void)(line);
    191.       ret = malloc(num);
    192.   #endif

crypto/mem.c:190:19: 
    188.       }
    189.   #else
    190. >     (void)(file); (void)(line);
    191.       ret = malloc(num);
    192.   #endif

crypto/mem.c:191:5: 
    189.   #else
    190.       (void)(file); (void)(line);
    191. >     ret = malloc(num);
    192.   #endif
    193.   

crypto/mem.c:194:5: 
    192.   #endif
    193.   
    194. >     return ret;
    195.   }
    196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
    193.   
    194.       return ret;
    195. > }
    196.   
    197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:202:9: Taking true branch
  200.   
  201.       FAILTEST();
  202.       if (ret != NULL)
                 ^
  203.           memset(ret, 0, num);
  204.       return ret;

crypto/mem.c:203:9: 
  201.       FAILTEST();
  202.       if (ret != NULL)
  203. >         memset(ret, 0, num);
  204.       return ret;
  205.   }

crypto/mem.c:204:5: 
  202.       if (ret != NULL)
  203.           memset(ret, 0, num);
  204. >     return ret;
  205.   }
  206.   

crypto/mem.c:205:1: return from a call to CRYPTO_zalloc
  203.           memset(ret, 0, num);
  204.       return ret;
  205. > }
  206.   
  207.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:68:9: Taking false branch
66.       OCSP_REQ_CTX *rctx = OPENSSL_zalloc(sizeof(*rctx));
67.   
68.       if (rctx == NULL)
              ^
69.           return NULL;
70.       rctx->state = OHS_ERROR;

crypto/ocsp/ocsp_ht.c:70:5: 
68.       if (rctx == NULL)
69.           return NULL;
70. >     rctx->state = OHS_ERROR;
71.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
72.       rctx->mem = BIO_new(BIO_s_mem());

crypto/ocsp/ocsp_ht.c:71:5: 
69.           return NULL;
70.       rctx->state = OHS_ERROR;
71. >     rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
72.       rctx->mem = BIO_new(BIO_s_mem());
73.       rctx->io = io;

crypto/ocsp/ocsp_ht.c:72:5: 
70.       rctx->state = OHS_ERROR;
71.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
72. >     rctx->mem = BIO_new(BIO_s_mem());
73.       rctx->io = io;
74.       if (maxline > 0)

crypto/bio/bss_mem.c:71:1: start of procedure BIO_s_mem()
  69.    */
  70.   
  71. > const BIO_METHOD *BIO_s_mem(void)
  72.   {
  73.       return (&mem_method);

crypto/bio/bss_mem.c:73:5: 
  71.   const BIO_METHOD *BIO_s_mem(void)
  72.   {
  73. >     return (&mem_method);
  74.   }
  75.   

crypto/bio/bss_mem.c:74:1: return from a call to BIO_s_mem
  72.   {
  73.       return (&mem_method);
  74. > }
  75.   
  76.   const BIO_METHOD *BIO_s_secmem(void)

crypto/ocsp/ocsp_ht.c:72:5: Skipping BIO_new(): empty list of specs
70.       rctx->state = OHS_ERROR;
71.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
72.       rctx->mem = BIO_new(BIO_s_mem());
          ^
73.       rctx->io = io;
74.       if (maxline > 0)

crypto/ocsp/ocsp_ht.c:73:5: 
71.       rctx->max_resp_len = OCSP_MAX_RESP_LENGTH;
72.       rctx->mem = BIO_new(BIO_s_mem());
73. >     rctx->io = io;
74.       if (maxline > 0)
75.           rctx->iobuflen = maxline;

crypto/ocsp/ocsp_ht.c:74:9: Taking true branch
72.       rctx->mem = BIO_new(BIO_s_mem());
73.       rctx->io = io;
74.       if (maxline > 0)
              ^
75.           rctx->iobuflen = maxline;
76.       else

crypto/ocsp/ocsp_ht.c:75:9: 
73.       rctx->io = io;
74.       if (maxline > 0)
75. >         rctx->iobuflen = maxline;
76.       else
77.           rctx->iobuflen = OCSP_MAX_LINE_LEN;

crypto/ocsp/ocsp_ht.c:78:5: 
76.       else
77.           rctx->iobuflen = OCSP_MAX_LINE_LEN;
78. >     rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
79.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
80.           OCSP_REQ_CTX_free(rctx);

crypto/mem.c:169:1: start of procedure CRYPTO_malloc()
  167.   #endif
  168.   
  169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171.       void *ret = NULL;

crypto/mem.c:171:5: 
  169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171. >     void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking false branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:176:9: Taking false branch
  174.           return malloc_impl(num, file, line);
  175.   
  176.       if (num == 0)
                 ^
  177.           return NULL;
  178.   

crypto/mem.c:180:5: 
  178.   
  179.       FAILTEST();
  180. >     allow_customize = 0;
  181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
  188.       }
  189.   #else
  190. >     (void)(file); (void)(line);
  191.       ret = malloc(num);
  192.   #endif

crypto/mem.c:190:19: 
  188.       }
  189.   #else
  190. >     (void)(file); (void)(line);
  191.       ret = malloc(num);
  192.   #endif

crypto/mem.c:191:5: 
  189.   #else
  190.       (void)(file); (void)(line);
  191. >     ret = malloc(num);
  192.   #endif
  193.   

crypto/mem.c:194:5: 
  192.   #endif
  193.   
  194. >     return ret;
  195.   }
  196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
  193.   
  194.       return ret;
  195. > }
  196.   
  197.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:79:9: Taking false branch
77.           rctx->iobuflen = OCSP_MAX_LINE_LEN;
78.       rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
79.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
              ^
80.           OCSP_REQ_CTX_free(rctx);
81.           return NULL;

crypto/ocsp/ocsp_ht.c:79:32: Taking true branch
77.           rctx->iobuflen = OCSP_MAX_LINE_LEN;
78.       rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
79.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
                                     ^
80.           OCSP_REQ_CTX_free(rctx);
81.           return NULL;

crypto/ocsp/ocsp_ht.c:80:9: 
78.       rctx->iobuf = OPENSSL_malloc(rctx->iobuflen);
79.       if (rctx->iobuf == NULL || rctx->mem == NULL) {
80. >         OCSP_REQ_CTX_free(rctx);
81.           return NULL;
82.       }

crypto/ocsp/ocsp_ht.c:86:1: start of procedure OCSP_REQ_CTX_free()
  84.   }
  85.   
  86. > void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
  87.   {
  88.       if (!rctx)

crypto/ocsp/ocsp_ht.c:88:10: Taking false branch
  86.   void OCSP_REQ_CTX_free(OCSP_REQ_CTX *rctx)
  87.   {
  88.       if (!rctx)
                 ^
  89.           return;
  90.       BIO_free(rctx->mem);

crypto/ocsp/ocsp_ht.c:90:5: Skipping BIO_free(): empty list of specs
  88.       if (!rctx)
  89.           return;
  90.       BIO_free(rctx->mem);
            ^
  91.       OPENSSL_free(rctx->iobuf);
  92.       OPENSSL_free(rctx);

crypto/ocsp/ocsp_ht.c:91:5: 
  89.           return;
  90.       BIO_free(rctx->mem);
  91. >     OPENSSL_free(rctx->iobuf);
  92.       OPENSSL_free(rctx);
  93.   }

crypto/mem.c:264:1: start of procedure CRYPTO_free()
    262.   }
    263.   
    264. > void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:266:9: Taking true branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:266:30: Taking true branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:267:9: Skipping __function_pointer__(): unresolved function pointer
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    267.           free_impl(str, file, line);
                   ^
    268.           return;
    269.       }

crypto/mem.c:268:9: 
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    267.           free_impl(str, file, line);
    268. >         return;
    269.       }
    270.   

crypto/mem.c:282:1: return from a call to CRYPTO_free
    280.       free(str);
    281.   #endif
    282. > }
    283.   
    284.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:92:5: 
  90.       BIO_free(rctx->mem);
  91.       OPENSSL_free(rctx->iobuf);
  92. >     OPENSSL_free(rctx);
  93.   }
  94.   

crypto/mem.c:264:1: start of procedure CRYPTO_free()
    262.   }
    263.   
    264. > void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:266:9: Taking false branch
    264.   void CRYPTO_free(void *str, const char *file, int line)
    265.   {
    266.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    267.           free_impl(str, file, line);
    268.           return;

crypto/mem.c:280:5: 
    278.       }
    279.   #else
    280. >     free(str);
    281.   #endif
    282.   }

crypto/mem.c:282:1: return from a call to CRYPTO_free
    280.       free(str);
    281.   #endif
    282. > }
    283.   
    284.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/ocsp/ocsp_ht.c:93:1: return from a call to OCSP_REQ_CTX_free
  91.       OPENSSL_free(rctx->iobuf);
  92.       OPENSSL_free(rctx);
  93. > }
  94.   
  95.   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    FAILTEST();\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    FAILTEST();\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); (void)(line);\n    ret = malloc(num);\n#endif\n    return ret;\n}', 'const BIO_METHOD *BIO_s_mem(void)\n{\n    return (&mem_method);\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}']