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


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

test/handshake_helper.c:282:5: 
280.       unsigned char *resp;
281.   
282. >     resp = OPENSSL_malloc(1);
283.       if (resp == NULL)
284.           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:9: Taking true branch
  202.   
  203.       FAILTEST();
  204.       if (allow_customize) {
                 ^
  205.           /*
  206.            * Disallow customization after the first allocation. We only set this

crypto/mem.c:210:9: 
  208.            * allocation.
  209.            */
  210. >         allow_customize = 0;
  211.       }
  212.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:221:5: 
  219.       }
  220.   #else
  221. >     (void)(file); (void)(line);
  222.       ret = malloc(num);
  223.   #endif

crypto/mem.c:221:19: 
  219.       }
  220.   #else
  221. >     (void)(file); (void)(line);
  222.       ret = malloc(num);
  223.   #endif

crypto/mem.c:222:5: 
  220.   #else
  221.       (void)(file); (void)(line);
  222. >     ret = malloc(num);
  223.   #endif
  224.   

crypto/mem.c:225:5: 
  223.   #endif
  224.   
  225. >     return ret;
  226.   }
  227.   

crypto/mem.c:226:1: return from a call to CRYPTO_malloc
  224.   
  225.       return ret;
  226. > }
  227.   
  228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/handshake_helper.c:283:9: Taking false branch
281.   
282.       resp = OPENSSL_malloc(1);
283.       if (resp == NULL)
               ^
284.           return SSL_TLSEXT_ERR_ALERT_FATAL;
285.       /*

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

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

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    if (allow_customize) {\n        allow_customize = 0;\n    }\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}']