test/handshake_helper.c:285: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_malloc()` at line 278, column 12 is not reachable after line 285, column 10.
Showing all 15 steps of the trace


test/handshake_helper.c:274:1: start of procedure server_ocsp_cb()
272.   static unsigned char dummy_ocsp_resp_bad_val = 0xfe;
273.   
274. > static int server_ocsp_cb(SSL *s, void *arg)
275.   {
276.       unsigned char *resp;

test/handshake_helper.c:278:5: 
276.       unsigned char *resp;
277.   
278. >     resp = OPENSSL_malloc(1);
279.       if (resp == NULL)
280.           return SSL_TLSEXT_ERR_ALERT_FATAL;

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
  190.   #endif
  191.   
  192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  193.   {
  194.       void *ret = NULL;

crypto/mem.c:194:5: 
  192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  193.   {
  194. >     void *ret = NULL;
  195.   
  196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking false branch
  195.   
  196.       INCREMENT(malloc_count);
  197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  198.           return malloc_impl(num, file, line);
  199.   

crypto/mem.c:200:9: Taking false branch
  198.           return malloc_impl(num, file, line);
  199.   
  200.       if (num == 0)
                 ^
  201.           return NULL;
  202.   

crypto/mem.c:204:5: 
  202.   
  203.       FAILTEST();
  204. >     allow_customize = 0;
  205.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  206.       if (call_malloc_debug) {

crypto/mem.c:214:5: 
  212.       }
  213.   #else
  214. >     (void)(file); (void)(line);
  215.       ret = malloc(num);
  216.   #endif

crypto/mem.c:214:19: 
  212.       }
  213.   #else
  214. >     (void)(file); (void)(line);
  215.       ret = malloc(num);
  216.   #endif

crypto/mem.c:215:5: 
  213.   #else
  214.       (void)(file); (void)(line);
  215. >     ret = malloc(num);
  216.   #endif
  217.   

crypto/mem.c:218:5: 
  216.   #endif
  217.   
  218. >     return ret;
  219.   }
  220.   

crypto/mem.c:219:1: return from a call to CRYPTO_malloc
  217.   
  218.       return ret;
  219. > }
  220.   
  221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/handshake_helper.c:279:9: Taking false branch
277.   
278.       resp = OPENSSL_malloc(1);
279.       if (resp == NULL)
               ^
280.           return SSL_TLSEXT_ERR_ALERT_FATAL;
281.       /*

test/handshake_helper.c:284:5: 
282.        * For the purposes of testing we just send back a dummy OCSP response
283.        */
284. >     *resp = *(unsigned char *)arg;
285.       if (!SSL_set_tlsext_status_ocsp_resp(s, resp, 1))
286.           return SSL_TLSEXT_ERR_ALERT_FATAL;

test/handshake_helper.c:285:10: Skipping SSL_ctrl(): empty list of specs
283.        */
284.       *resp = *(unsigned char *)arg;
285.       if (!SSL_set_tlsext_status_ocsp_resp(s, resp, 1))
                ^
286.           return SSL_TLSEXT_ERR_ALERT_FATAL;
287.   

static int server_ocsp_cb(SSL *s, void *arg)
{
    unsigned char *resp;
    resp = OPENSSL_malloc(1);
    if (resp == NULL)
        return SSL_TLSEXT_ERR_ALERT_FATAL;
    *resp = *(unsigned char *)arg;
    if (!SSL_set_tlsext_status_ocsp_resp(s, resp, 1))
        return SSL_TLSEXT_ERR_ALERT_FATAL;
    return SSL_TLSEXT_ERR_OK;
}
['static int server_ocsp_cb(SSL *s, void *arg)\n{\n    unsigned char *resp;\n    resp = OPENSSL_malloc(1);\n    if (resp == NULL)\n        return SSL_TLSEXT_ERR_ALERT_FATAL;\n    *resp = *(unsigned char *)arg;\n    if (!SSL_set_tlsext_status_ocsp_resp(s, resp, 1))\n        return SSL_TLSEXT_ERR_ALERT_FATAL;\n    return SSL_TLSEXT_ERR_OK;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    INCREMENT(malloc_count);\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}']