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


crypto/ocsp/ocsp_vfy.c:378:1: start of procedure OCSP_request_verify()
376.    */
377.   
378. > int OCSP_request_verify(OCSP_REQUEST *req, STACK_OF(X509) *certs,
379.                           X509_STORE *store, unsigned long flags)
380.   {

crypto/ocsp/ocsp_vfy.c:384:5: 
382.       X509_NAME *nm;
383.       GENERAL_NAME *gen;
384. >     int ret = 0;
385.       X509_STORE_CTX *ctx = X509_STORE_CTX_new();
386.   

crypto/ocsp/ocsp_vfy.c:385:5: 
383.       GENERAL_NAME *gen;
384.       int ret = 0;
385. >     X509_STORE_CTX *ctx = X509_STORE_CTX_new();
386.   
387.       if (ctx == NULL) {

crypto/x509/x509_vfy.c:2115:1: start of procedure X509_STORE_CTX_new()
  2113.   }
  2114.   
  2115. > X509_STORE_CTX *X509_STORE_CTX_new(void)
  2116.   {
  2117.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/x509/x509_vfy.c:2117:5: 
  2115.   X509_STORE_CTX *X509_STORE_CTX_new(void)
  2116.   {
  2117. >     X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2118.   
  2119.       if (ctx == NULL) {

crypto/mem.c:146:1: start of procedure CRYPTO_zalloc()
    144.   }
    145.   
    146. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:148:5: 
    146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    147.   {
    148. >     void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       if (ret != NULL)

crypto/mem.c:119:1: start of procedure CRYPTO_malloc()
      117.   }
      118.   
      119. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121.       void *ret = NULL;

crypto/mem.c:121:5: 
      119.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      120.   {
      121. >     void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                     ^
      124.           return malloc_impl(num, file, line);
      125.   

crypto/mem.c:126:9: Taking false branch
      124.           return malloc_impl(num, file, line);
      125.   
      126.       if (num <= 0)
                     ^
      127.           return NULL;
      128.   

crypto/mem.c:129:5: 
      127.           return NULL;
      128.   
      129. >     allow_customize = 0;
      130.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      131.       if (call_malloc_debug) {

crypto/mem.c:139:5: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:139:24: 
      137.       }
      138.   #else
      139. >     osslargused(file); osslargused(line);
      140.       ret = malloc(num);
      141.   #endif

crypto/mem.c:140:5: 
      138.   #else
      139.       osslargused(file); osslargused(line);
      140. >     ret = malloc(num);
      141.   #endif
      142.   

crypto/mem.c:143:5: 
      141.   #endif
      142.   
      143. >     return ret;
      144.   }
      145.   

crypto/mem.c:144:1: return from a call to CRYPTO_malloc
      142.   
      143.       return ret;
      144. > }
      145.   
      146.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:150:9: Taking true branch
    148.       void *ret = CRYPTO_malloc(num, file, line);
    149.   
    150.       if (ret != NULL)
                   ^
    151.           memset(ret, 0, num);
    152.       return ret;

crypto/mem.c:151:9: 
    149.   
    150.       if (ret != NULL)
    151. >         memset(ret, 0, num);
    152.       return ret;
    153.   }

crypto/mem.c:152:5: 
    150.       if (ret != NULL)
    151.           memset(ret, 0, num);
    152. >     return ret;
    153.   }
    154.   

crypto/mem.c:153:1: return from a call to CRYPTO_zalloc
    151.           memset(ret, 0, num);
    152.       return ret;
    153. > }
    154.   
    155.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2119:9: Taking false branch
  2117.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2118.   
  2119.       if (ctx == NULL) {
                  ^
  2120.           X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
  2121.           return NULL;

crypto/x509/x509_vfy.c:2123:5: 
  2121.           return NULL;
  2122.       }
  2123. >     return ctx;
  2124.   }
  2125.   

crypto/x509/x509_vfy.c:2124:1: return from a call to X509_STORE_CTX_new
  2122.       }
  2123.       return ctx;
  2124. > }
  2125.   
  2126.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)

crypto/ocsp/ocsp_vfy.c:387:9: Taking false branch
385.       X509_STORE_CTX *ctx = X509_STORE_CTX_new();
386.   
387.       if (ctx == NULL) {
               ^
388.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, ERR_R_MALLOC_FAILURE);
389.           goto err;

crypto/ocsp/ocsp_vfy.c:392:10: Taking false branch
390.       }
391.   
392.       if (!req->optionalSignature) {
                ^
393.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY, OCSP_R_REQUEST_NOT_SIGNED);
394.           goto err;

crypto/ocsp/ocsp_vfy.c:396:5: 
394.           goto err;
395.       }
396. >     gen = req->tbsRequest.requestorName;
397.       if (!gen || gen->type != GEN_DIRNAME) {
398.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,

crypto/ocsp/ocsp_vfy.c:397:10: Taking false branch
395.       }
396.       gen = req->tbsRequest.requestorName;
397.       if (!gen || gen->type != GEN_DIRNAME) {
                ^
398.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,
399.                   OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE);

crypto/ocsp/ocsp_vfy.c:397:17: Taking true branch
395.       }
396.       gen = req->tbsRequest.requestorName;
397.       if (!gen || gen->type != GEN_DIRNAME) {
                       ^
398.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,
399.                   OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE);

crypto/ocsp/ocsp_vfy.c:398:9: Skipping ERR_put_error(): empty list of specs
396.       gen = req->tbsRequest.requestorName;
397.       if (!gen || gen->type != GEN_DIRNAME) {
398.           OCSPerr(OCSP_F_OCSP_REQUEST_VERIFY,
               ^
399.                   OCSP_R_UNSUPPORTED_REQUESTORNAME_TYPE);
400.           goto err;

crypto/ocsp/ocsp_vfy.c:447:1: 
445.       goto end;
446.   
447. > err:
448.       ret = 0;
449.   end:

crypto/ocsp/ocsp_vfy.c:448:5: 
446.   
447.   err:
448. >     ret = 0;
449.   end:
450.       X509_STORE_CTX_free(ctx);

crypto/ocsp/ocsp_vfy.c:449:1: 
447.   err:
448.       ret = 0;
449. > end:
450.       X509_STORE_CTX_free(ctx);
451.       return ret;

crypto/ocsp/ocsp_vfy.c:450:5: 
448.       ret = 0;
449.   end:
450. >     X509_STORE_CTX_free(ctx);
451.       return ret;
452.   

crypto/x509/x509_vfy.c:2126:1: start of procedure X509_STORE_CTX_free()
  2124.   }
  2125.   
  2126. > void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2127.   {
  2128.       if (ctx == NULL)

crypto/x509/x509_vfy.c:2128:9: Taking false branch
  2126.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2127.   {
  2128.       if (ctx == NULL)
                  ^
  2129.           return;
  2130.   

crypto/x509/x509_vfy.c:2131:5: Skipping X509_STORE_CTX_cleanup(): empty list of specs
  2129.           return;
  2130.   
  2131.       X509_STORE_CTX_cleanup(ctx);
              ^
  2132.       OPENSSL_free(ctx);
  2133.   }

crypto/x509/x509_vfy.c:2132:5: 
  2130.   
  2131.       X509_STORE_CTX_cleanup(ctx);
  2132. >     OPENSSL_free(ctx);
  2133.   }
  2134.   

crypto/mem.c:210:1: start of procedure CRYPTO_free()
    208.   }
    209.   
    210. > void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:212:9: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:212:30: Taking true branch
    210.   void CRYPTO_free(void *str, const char *file, int line)
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    213.           free_impl(str, file, line);
    214.           return;

crypto/mem.c:213:9: Skipping __function_pointer__(): unresolved function pointer
    211.   {
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
                   ^
    214.           return;
    215.       }

crypto/mem.c:214:9: 
    212.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    213.           free_impl(str, file, line);
    214. >         return;
    215.       }
    216.   

crypto/mem.c:228:1: return from a call to CRYPTO_free
    226.       free(str);
    227.   #endif
    228. > }
    229.   
    230.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2133:1: return from a call to X509_STORE_CTX_free
  2131.       X509_STORE_CTX_cleanup(ctx);
  2132.       OPENSSL_free(ctx);
  2133. > }
  2134.   
  2135.   int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
