test/sslapitest.c:1052: error: MEMORY_LEAK
  memory dynamically allocated by call to `CRYPTO_memdup()` at line 1049, column 10 is not reachable after line 1052, column 5.
Showing all 31 steps of the trace


test/sslapitest.c:1029:1: start of procedure ocsp_server_cb()
1027.   
1028.   #ifndef OPENSSL_NO_OCSP
1029. > static int ocsp_server_cb(SSL *s, void *arg)
1030.   {
1031.       int *argi = (int *)arg;

test/sslapitest.c:1031:5: 
1029.   static int ocsp_server_cb(SSL *s, void *arg)
1030.   {
1031. >     int *argi = (int *)arg;
1032.       unsigned char *copy = NULL;
1033.       STACK_OF(OCSP_RESPID) *ids = NULL;

test/sslapitest.c:1032:5: 
1030.   {
1031.       int *argi = (int *)arg;
1032. >     unsigned char *copy = NULL;
1033.       STACK_OF(OCSP_RESPID) *ids = NULL;
1034.       OCSP_RESPID *id = NULL;

test/sslapitest.c:1033:5: 
1031.       int *argi = (int *)arg;
1032.       unsigned char *copy = NULL;
1033. >     STACK_OF(OCSP_RESPID) *ids = NULL;
1034.       OCSP_RESPID *id = NULL;
1035.   

test/sslapitest.c:1034:5: 
1032.       unsigned char *copy = NULL;
1033.       STACK_OF(OCSP_RESPID) *ids = NULL;
1034. >     OCSP_RESPID *id = NULL;
1035.   
1036.       if (*argi == 2) {

test/sslapitest.c:1036:9: Taking false branch
1034.       OCSP_RESPID *id = NULL;
1035.   
1036.       if (*argi == 2) {
                ^
1037.           /* In this test we are expecting exactly 1 OCSP_RESPID */
1038.           SSL_get_tlsext_status_ids(s, &ids);

test/sslapitest.c:1045:16: Taking false branch
1043.           if (id == NULL || !OCSP_RESPID_match(id, ocspcert))
1044.               return SSL_TLSEXT_ERR_ALERT_FATAL;
1045.       } else if (*argi != 1) {
                       ^
1046.           return SSL_TLSEXT_ERR_ALERT_FATAL;
1047.       }

test/sslapitest.c:1049:10: 
1047.       }
1048.   
1049. >     if (!TEST_ptr(copy = OPENSSL_memdup(orespder, sizeof(orespder))))
1050.           return SSL_TLSEXT_ERR_ALERT_FATAL;
1051.   

crypto/o_str.c:57:1: start of procedure CRYPTO_memdup()
  55.   }
  56.   
  57. > void *CRYPTO_memdup(const void *data, size_t siz, const char* file, int line)
  58.   {
  59.       void *ret;

crypto/o_str.c:61:9: Taking false branch
  59.       void *ret;
  60.   
  61.       if (data == NULL || siz >= INT_MAX)
                ^
  62.           return NULL;
  63.   

crypto/o_str.c:61:25: Taking false branch
  59.       void *ret;
  60.   
  61.       if (data == NULL || siz >= INT_MAX)
                                ^
  62.           return NULL;
  63.   

crypto/o_str.c:64:5: 
  62.           return NULL;
  63.   
  64. >     ret = CRYPTO_malloc(siz, file, line);
  65.       if (ret == NULL) {
  66.           CRYPTOerr(CRYPTO_F_CRYPTO_MEMDUP, ERR_R_MALLOC_FAILURE);

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 false branch
    202.   
    203.       FAILTEST();
    204.       if (allow_customize) {
                   ^
    205.           /*
    206.            * Disallow customization after the first allocation. We only set this

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)

crypto/o_str.c:65:9: Taking false branch
  63.   
  64.       ret = CRYPTO_malloc(siz, file, line);
  65.       if (ret == NULL) {
                ^
  66.           CRYPTOerr(CRYPTO_F_CRYPTO_MEMDUP, ERR_R_MALLOC_FAILURE);
  67.           return NULL;

crypto/o_str.c:69:5: 
  67.           return NULL;
  68.       }
  69. >     return memcpy(ret, data, siz);
  70.   }
  71.   

crypto/o_str.c:70:1: return from a call to CRYPTO_memdup
  68.       }
  69.       return memcpy(ret, data, siz);
  70. > }
  71.   
  72.   size_t OPENSSL_strnlen(const char *str, size_t maxlen)

test/testutil/tests.c:229:1: start of procedure test_ptr()
  227.   }
  228.   
  229. > int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)

test/testutil/tests.c:231:9: Taking true branch
  229.   int test_ptr(const char *file, int line, const char *s, const void *p)
  230.   {
  231.       if (p != NULL)
                 ^
  232.           return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);

test/testutil/tests.c:232:9: 
  230.   {
  231.       if (p != NULL)
  232. >         return 1;
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;

test/testutil/tests.c:235:1: return from a call to test_ptr
  233.       test_fail_message(NULL, file, line, "ptr", s, "NULL", "!=", "%p", p);
  234.       return 0;
  235. > }
  236.   
  237.   int test_true(const char *file, int line, const char *s, int b)

test/sslapitest.c:1049:10: Taking false branch
1047.       }
1048.   
1049.       if (!TEST_ptr(copy = OPENSSL_memdup(orespder, sizeof(orespder))))
                 ^
1050.           return SSL_TLSEXT_ERR_ALERT_FATAL;
1051.   

test/sslapitest.c:1052:5: Skipping SSL_ctrl(): empty list of specs
1050.           return SSL_TLSEXT_ERR_ALERT_FATAL;
1051.   
1052.       SSL_set_tlsext_status_ocsp_resp(s, copy, sizeof(orespder));
            ^
1053.       ocsp_server_called = 1;
1054.       return SSL_TLSEXT_ERR_OK;
