crypto/ts/ts_rsp_verify.c:194: error: MEMORY_LEAK
  memory dynamically allocated by call to `X509_STORE_CTX_new()` at line 170, column 16 is not reachable after line 194, column 5.
Showing all 41 steps of the trace


crypto/ts/ts_rsp_verify.c:162:1: start of procedure ts_verify_cert()
160.    * freeing the vector.
161.    */
162. > static int ts_verify_cert(X509_STORE *store, STACK_OF(X509) *untrusted,
163.                             X509 *signer, STACK_OF(X509) **chain)
164.   {

crypto/ts/ts_rsp_verify.c:165:5: 
163.                             X509 *signer, STACK_OF(X509) **chain)
164.   {
165. >     X509_STORE_CTX *cert_ctx = NULL;
166.       int i;
167.       int ret = 0;

crypto/ts/ts_rsp_verify.c:167:5: 
165.       X509_STORE_CTX *cert_ctx = NULL;
166.       int i;
167. >     int ret = 0;
168.   
169.       *chain = NULL;

crypto/ts/ts_rsp_verify.c:169:5: 
167.       int ret = 0;
168.   
169. >     *chain = NULL;
170.       cert_ctx = X509_STORE_CTX_new();
171.       if (cert_ctx == NULL) {

crypto/ts/ts_rsp_verify.c:170:5: 
168.   
169.       *chain = NULL;
170. >     cert_ctx = X509_STORE_CTX_new();
171.       if (cert_ctx == NULL) {
172.           TSerr(TS_F_TS_VERIFY_CERT, ERR_R_MALLOC_FAILURE);

crypto/x509/x509_vfy.c:2185:1: start of procedure X509_STORE_CTX_new()
  2183.   }
  2184.   
  2185. > X509_STORE_CTX *X509_STORE_CTX_new(void)
  2186.   {
  2187.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/x509/x509_vfy.c:2187:5: 
  2185.   X509_STORE_CTX *X509_STORE_CTX_new(void)
  2186.   {
  2187. >     X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2188.   
  2189.       if (ctx == NULL) {

crypto/mem.c:98:1: start of procedure CRYPTO_zalloc()
    96.   }
    97.   
    98. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:100:5: 
    98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    99.   {
    100. >     void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
      69.   }
      70.   
      71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
      72.   {
      73.       void *ret = NULL;

crypto/mem.c:73:5: 
      71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
      72.   {
      73. >     void *ret = NULL;
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
      73.       void *ret = NULL;
      74.   
      75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                    ^
      76.           return malloc_impl(num, file, line);
      77.   

crypto/mem.c:78:9: Taking false branch
      76.           return malloc_impl(num, file, line);
      77.   
      78.       if (num <= 0)
                    ^
      79.           return NULL;
      80.   

crypto/mem.c:81:5: 
      79.           return NULL;
      80.   
      81. >     allow_customize = 0;
      82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
      89.       }
      90.   #else
      91. >     osslargused(file); osslargused(line);
      92.       ret = malloc(num);
      93.   #endif

crypto/mem.c:91:24: 
      89.       }
      90.   #else
      91. >     osslargused(file); osslargused(line);
      92.       ret = malloc(num);
      93.   #endif

crypto/mem.c:92:5: 
      90.   #else
      91.       osslargused(file); osslargused(line);
      92. >     ret = malloc(num);
      93.   #endif
      94.   

crypto/mem.c:95:5: 
      93.   #endif
      94.   
      95. >     return ret;
      96.   }
      97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
      94.   
      95.       return ret;
      96. > }
      97.   
      98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:102:9: Taking true branch
    100.       void *ret = CRYPTO_malloc(num, file, line);
    101.   
    102.       if (ret != NULL)
                   ^
    103.           memset(ret, 0, num);
    104.       return ret;

crypto/mem.c:103:9: 
    101.   
    102.       if (ret != NULL)
    103. >         memset(ret, 0, num);
    104.       return ret;
    105.   }

crypto/mem.c:104:5: 
    102.       if (ret != NULL)
    103.           memset(ret, 0, num);
    104. >     return ret;
    105.   }
    106.   

crypto/mem.c:105:1: return from a call to CRYPTO_zalloc
    103.           memset(ret, 0, num);
    104.       return ret;
    105. > }
    106.   
    107.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2189:9: Taking false branch
  2187.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2188.   
  2189.       if (ctx == NULL) {
                  ^
  2190.           X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
  2191.           return NULL;

crypto/x509/x509_vfy.c:2193:5: 
  2191.           return NULL;
  2192.       }
  2193. >     return ctx;
  2194.   }
  2195.   

crypto/x509/x509_vfy.c:2194:1: return from a call to X509_STORE_CTX_new
  2192.       }
  2193.       return ctx;
  2194. > }
  2195.   
  2196.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)

crypto/ts/ts_rsp_verify.c:171:9: Taking false branch
169.       *chain = NULL;
170.       cert_ctx = X509_STORE_CTX_new();
171.       if (cert_ctx == NULL) {
               ^
172.           TSerr(TS_F_TS_VERIFY_CERT, ERR_R_MALLOC_FAILURE);
173.           goto err;

crypto/ts/ts_rsp_verify.c:175:10: Taking true branch
173.           goto err;
174.       }
175.       if (!X509_STORE_CTX_init(cert_ctx, store, signer, untrusted))
                ^
176.           goto end;
177.       X509_STORE_CTX_set_purpose(cert_ctx, X509_PURPOSE_TIMESTAMP_SIGN);

crypto/ts/ts_rsp_verify.c:193:1: 
191.       ret = 0;
192.   
193. > end:
194.       X509_STORE_CTX_free(cert_ctx);
195.       return ret;

crypto/ts/ts_rsp_verify.c:194:5: 
192.   
193.   end:
194. >     X509_STORE_CTX_free(cert_ctx);
195.       return ret;
196.   }

crypto/x509/x509_vfy.c:2196:1: start of procedure X509_STORE_CTX_free()
  2194.   }
  2195.   
  2196. > void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2197.   {
  2198.       if (ctx == NULL)

crypto/x509/x509_vfy.c:2198:9: Taking false branch
  2196.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2197.   {
  2198.       if (ctx == NULL)
                  ^
  2199.           return;
  2200.   

crypto/x509/x509_vfy.c:2201:5: Skipping X509_STORE_CTX_cleanup(): empty list of specs
  2199.           return;
  2200.   
  2201.       X509_STORE_CTX_cleanup(ctx);
              ^
  2202.       OPENSSL_free(ctx);
  2203.   }

crypto/x509/x509_vfy.c:2202:5: 
  2200.   
  2201.       X509_STORE_CTX_cleanup(ctx);
  2202. >     OPENSSL_free(ctx);
  2203.   }
  2204.   

crypto/mem.c:163:1: start of procedure CRYPTO_free()
    161.   }
    162.   
    163. > void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:165:9: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:165:30: Taking true branch
    163.   void CRYPTO_free(void *str, const char *file, int line)
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    166.           free_impl(str, file, line);
    167.           return;

crypto/mem.c:166:9: Skipping __function_pointer__(): unresolved function pointer
    164.   {
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
                   ^
    167.           return;
    168.       }

crypto/mem.c:167:9: 
    165.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    166.           free_impl(str, file, line);
    167. >         return;
    168.       }
    169.   

crypto/mem.c:181:1: return from a call to CRYPTO_free
    179.       free(str);
    180.   #endif
    181. > }
    182.   
    183.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2203:1: return from a call to X509_STORE_CTX_free
  2201.       X509_STORE_CTX_cleanup(ctx);
  2202.       OPENSSL_free(ctx);
  2203. > }
  2204.   
  2205.   int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
