crypto/ocsp/ocsp_vfy.c:400: error: MEMORY_LEAK
  memory dynamically allocated by call to `X509_STORE_CTX_new()` at line 335, column 27 is not reachable after line 400, column 5.
Showing all 58 steps of the trace


crypto/ocsp/ocsp_vfy.c:328:1: start of procedure OCSP_request_verify()
326.    */
327.   
328. > int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
329.                           X509_STORE *store, unsigned long flags)
330.   {

crypto/ocsp/ocsp_vfy.c:334:5: 
332.       X509_NAME *nm;
333.       GENERAL_NAME *gen;
334. >     int ret = 0;
335.       X509_STORE_CTX *ctx = X509_STORE_CTX_new();
336.   

crypto/ocsp/ocsp_vfy.c:335:5: 
333.       GENERAL_NAME *gen;
334.       int ret = 0;
335. >     X509_STORE_CTX *ctx = X509_STORE_CTX_new();
336.   
337.       if (ctx == NULL) {

crypto/x509/x509_vfy.c:2150:1: start of procedure X509_STORE_CTX_new()
  2148.   }
  2149.   
  2150. > X509_STORE_CTX *X509_STORE_CTX_new(void)
  2151.   {
  2152.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/x509/x509_vfy.c:2152:5: 
  2150.   X509_STORE_CTX *X509_STORE_CTX_new(void)
  2151.   {
  2152. >     X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2153.   
  2154.       if (ctx == 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. >     osslargused(file); osslargused(line);
      191.       ret = malloc(num);
      192.   #endif

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

crypto/mem.c:191:5: 
      189.   #else
      190.       osslargused(file); osslargused(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/x509/x509_vfy.c:2154:9: Taking false branch
  2152.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2153.   
  2154.       if (ctx == NULL) {
                  ^
  2155.           X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
  2156.           return NULL;

crypto/x509/x509_vfy.c:2158:5: 
  2156.           return NULL;
  2157.       }
  2158. >     return ctx;
  2159.   }
  2160.   

crypto/x509/x509_vfy.c:2159:1: return from a call to X509_STORE_CTX_new
  2157.       }
  2158.       return ctx;
  2159. > }
  2160.   
  2161.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)

crypto/ocsp/ocsp_vfy.c:337:9: Taking false branch
335.       X509_STORE_CTX *ctx = X509_STORE_CTX_new();
336.   
337.       if (ctx == NULL) {
               ^
338.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, ERR_R_MALLOC_FAILURE);
339.           goto err;

crypto/ocsp/ocsp_vfy.c:342:10: Taking true branch
340.       }
341.   
342.       if (!req->optionalSignature) {
                ^
343.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, OCSP_R_REQUEST_NOT_SIGNED);
344.           goto err;

crypto/ocsp/ocsp_vfy.c:343:9: 
341.   
342.       if (!req->optionalSignature) {
343. >         OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, OCSP_R_REQUEST_NOT_SIGNED);
344.           goto err;
345.       }

crypto/err/err.c:365:1: start of procedure ERR_put_error()
  363.   /********************************************************/
  364.   
  365. > void ERR_put_error(int lib, int func, int reason, const char *file, int line)
  366.   {
  367.       ERR_STATE *es;

crypto/err/err.c:388:5: 
  386.       }
  387.   #endif
  388. >     es = ERR_get_state();
  389.       if (es == NULL)
  390.           return;

crypto/err/err.c:679:1: start of procedure ERR_get_state()
    677.   }
    678.   
    679. > ERR_STATE *ERR_get_state(void)
    680.   {
    681.       ERR_STATE *state = NULL;

crypto/err/err.c:681:5: 
    679.   ERR_STATE *ERR_get_state(void)
    680.   {
    681. >     ERR_STATE *state = NULL;
    682.   
    683.       if (!RUN_ONCE(&err_init, err_do_init))

crypto/err/err.c:683:10: 
    681.       ERR_STATE *state = NULL;
    682.   
    683. >     if (!RUN_ONCE(&err_init, err_do_init))
    684.           return NULL;
    685.   

crypto/threads_pthread.c:105:1: start of procedure CRYPTO_THREAD_run_once()
      103.   }
      104.   
      105. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      106.   {
      107.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:107:9: Taking true branch
      105.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
      106.   {
      107.       if (pthread_once(once, init) != 0)
                     ^
      108.           return 0;
      109.   

crypto/threads_pthread.c:108:9: 
      106.   {
      107.       if (pthread_once(once, init) != 0)
      108. >         return 0;
      109.   
      110.       return 1;

crypto/threads_pthread.c:111:1: return from a call to CRYPTO_THREAD_run_once
      109.   
      110.       return 1;
      111. > }
      112.   
      113.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/err/err.c:683:10: Condition is false
    681.       ERR_STATE *state = NULL;
    682.   
    683.       if (!RUN_ONCE(&err_init, err_do_init))
                    ^
    684.           return NULL;
    685.   

crypto/err/err.c:683:10: Taking true branch
    681.       ERR_STATE *state = NULL;
    682.   
    683.       if (!RUN_ONCE(&err_init, err_do_init))
                    ^
    684.           return NULL;
    685.   

crypto/err/err.c:684:9: 
    682.   
    683.       if (!RUN_ONCE(&err_init, err_do_init))
    684. >         return NULL;
    685.   
    686.       state = CRYPTO_THREAD_get_local(&err_thread_local);

crypto/err/err.c:704:1: return from a call to ERR_get_state
    702.   
    703.       return state;
    704. > }
    705.   
    706.   int ERR_get_next_error_library(void)

crypto/err/err.c:389:9: Taking true branch
  387.   #endif
  388.       es = ERR_get_state();
  389.       if (es == NULL)
                 ^
  390.           return;
  391.   

crypto/err/err.c:390:9: 
  388.       es = ERR_get_state();
  389.       if (es == NULL)
  390. >         return;
  391.   
  392.       es->top = (es->top + 1) % ERR_NUM_ERRORS;

crypto/err/err.c:400:1: return from a call to ERR_put_error
  398.       es->err_line[es->top] = line;
  399.       err_clear_data(es, es->top);
  400. > }
  401.   
  402.   void ERR_clear_error(void)

crypto/ocsp/ocsp_vfy.c:397:1: 
395.       goto end;
396.   
397. > err:
398.       ret = 0;
399.   end:

crypto/ocsp/ocsp_vfy.c:398:5: 
396.   
397.   err:
398. >     ret = 0;
399.   end:
400.       X509_STORE_CTX_free(ctx);

crypto/ocsp/ocsp_vfy.c:399:1: 
397.   err:
398.       ret = 0;
399. > end:
400.       X509_STORE_CTX_free(ctx);
401.       return ret;

crypto/ocsp/ocsp_vfy.c:400:5: 
398.       ret = 0;
399.   end:
400. >     X509_STORE_CTX_free(ctx);
401.       return ret;
402.   

crypto/x509/x509_vfy.c:2161:1: start of procedure X509_STORE_CTX_free()
  2159.   }
  2160.   
  2161. > void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2162.   {
  2163.       if (ctx == NULL)

crypto/x509/x509_vfy.c:2163:9: Taking false branch
  2161.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2162.   {
  2163.       if (ctx == NULL)
                  ^
  2164.           return;
  2165.   

crypto/x509/x509_vfy.c:2166:5: Skipping X509_STORE_CTX_cleanup(): empty list of specs
  2164.           return;
  2165.   
  2166.       X509_STORE_CTX_cleanup(ctx);
              ^
  2167.       OPENSSL_free(ctx);
  2168.   }

crypto/x509/x509_vfy.c:2167:5: 
  2165.   
  2166.       X509_STORE_CTX_cleanup(ctx);
  2167. >     OPENSSL_free(ctx);
  2168.   }
  2169.   

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/x509/x509_vfy.c:2168:1: return from a call to X509_STORE_CTX_free
  2166.       X509_STORE_CTX_cleanup(ctx);
  2167.       OPENSSL_free(ctx);
  2168. > }
  2169.   
  2170.   int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
