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:98:1: start of procedure CRYPTO_zalloc()
  96.   }
  97.   
  98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  99.   {
  100. >     void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)

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)

crypto/mem.c:102:9: Taking true branch
  100.       void *ret = CRYPTO_malloc(num, file, line);
  101.   
  102.       if (ret != NULL)
                 ^
  103.           memset(ret, 0, num);
  104.       return ret;

crypto/mem.c:103:9: 
  101.   
  102.       if (ret != NULL)
  103. >         memset(ret, 0, num);
  104.       return ret;
  105.   }

crypto/mem.c:104:5: 
  102.       if (ret != NULL)
  103.           memset(ret, 0, num);
  104. >     return ret;
  105.   }
  106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
  103.           memset(ret, 0, num);
  104.       return ret;
  105. > }
  106.   
  107.   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:63:1: start of procedure BIO_s_mem()
  61.    */
  62.   
  63. > const BIO_METHOD *BIO_s_mem(void)
  64.   {
  65.       return (&mem_method);

crypto/bio/bss_mem.c:65:5: 
  63.   const BIO_METHOD *BIO_s_mem(void)
  64.   {
  65. >     return (&mem_method);
  66.   }
  67.   

crypto/bio/bss_mem.c:66:1: return from a call to BIO_s_mem
  64.   {
  65.       return (&mem_method);
  66. > }
  67.   
  68.   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: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)

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:163:1: start of procedure CRYPTO_free()
    161.   }
    162.   
    163. > void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:165:30: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
                   ^
    167.           return;
    168.       }

crypto/mem.c:167:9: 
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
    167. >         return;
    168.       }
    169.   

crypto/mem.c:181:1: return from a call to CRYPTO_free
    179.       free(str);
    180.   #endif
    181. > }
    182.   
    183.   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:163:1: start of procedure CRYPTO_free()
    161.   }
    162.   
    163. > void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking false branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:179:5: 
    177.       }
    178.   #else
    179. >     free(str);
    180.   #endif
    181.   }

crypto/mem.c:181:1: return from a call to CRYPTO_free
    179.       free(str);
    180.   #endif
    181. > }
    182.   
    183.   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    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}', '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}']