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


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

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

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

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

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

crypto/x509/x509_vfy.c:2179:1: start of procedure X509_STORE_CTX_new()
  2177.   }
  2178.   
  2179. > X509_STORE_CTX *X509_STORE_CTX_new(void)
  2180.   {
  2181.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/x509/x509_vfy.c:2181:5: 
  2179.   X509_STORE_CTX *X509_STORE_CTX_new(void)
  2180.   {
  2181. >     X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2182.   
  2183.       if (ctx == NULL) {

crypto/mem.c:228:1: start of procedure CRYPTO_zalloc()
    226.   }
    227.   
    228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:5: 
    228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    229.   {
    230. >     void *ret = CRYPTO_malloc(num, file, line);
    231.   
    232.       FAILTEST();

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)

crypto/mem.c:233:9: Taking true branch
    231.   
    232.       FAILTEST();
    233.       if (ret != NULL)
                   ^
    234.           memset(ret, 0, num);
    235.       return ret;

crypto/mem.c:234:9: 
    232.       FAILTEST();
    233.       if (ret != NULL)
    234. >         memset(ret, 0, num);
    235.       return ret;
    236.   }

crypto/mem.c:235:5: 
    233.       if (ret != NULL)
    234.           memset(ret, 0, num);
    235. >     return ret;
    236.   }
    237.   

crypto/mem.c:236:1: return from a call to CRYPTO_zalloc
    234.           memset(ret, 0, num);
    235.       return ret;
    236. > }
    237.   
    238.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2183:9: Taking false branch
  2181.       X509_STORE_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  2182.   
  2183.       if (ctx == NULL) {
                  ^
  2184.           X509err(X509_F_X509_STORE_CTX_NEW, ERR_R_MALLOC_FAILURE);
  2185.           return NULL;

crypto/x509/x509_vfy.c:2187:5: 
  2185.           return NULL;
  2186.       }
  2187. >     return ctx;
  2188.   }
  2189.   

crypto/x509/x509_vfy.c:2188:1: return from a call to X509_STORE_CTX_new
  2186.       }
  2187.       return ctx;
  2188. > }
  2189.   
  2190.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)

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

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

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

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

crypto/x509/x509_vfy.c:2190:1: start of procedure X509_STORE_CTX_free()
  2188.   }
  2189.   
  2190. > void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2191.   {
  2192.       if (ctx == NULL)

crypto/x509/x509_vfy.c:2192:9: Taking false branch
  2190.   void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
  2191.   {
  2192.       if (ctx == NULL)
                  ^
  2193.           return;
  2194.   

crypto/x509/x509_vfy.c:2195:5: Skipping X509_STORE_CTX_cleanup(): empty list of specs
  2193.           return;
  2194.   
  2195.       X509_STORE_CTX_cleanup(ctx);
              ^
  2196.       OPENSSL_free(ctx);
  2197.   }

crypto/x509/x509_vfy.c:2196:5: 
  2194.   
  2195.       X509_STORE_CTX_cleanup(ctx);
  2196. >     OPENSSL_free(ctx);
  2197.   }
  2198.   

crypto/mem.c:295:1: start of procedure CRYPTO_free()
    293.   }
    294.   
    295. > void CRYPTO_free(void *str, const char *file, int line)
    296.   {
    297.       INCREMENT(free_count);

crypto/mem.c:298:9: Taking true branch
    296.   {
    297.       INCREMENT(free_count);
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    299.           free_impl(str, file, line);
    300.           return;

crypto/mem.c:298:30: Taking true branch
    296.   {
    297.       INCREMENT(free_count);
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    299.           free_impl(str, file, line);
    300.           return;

crypto/mem.c:299:9: Skipping __function_pointer__(): unresolved function pointer
    297.       INCREMENT(free_count);
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    299.           free_impl(str, file, line);
                   ^
    300.           return;
    301.       }

crypto/mem.c:300:9: 
    298.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    299.           free_impl(str, file, line);
    300. >         return;
    301.       }
    302.   

crypto/mem.c:314:1: return from a call to CRYPTO_free
    312.       free(str);
    313.   #endif
    314. > }
    315.   
    316.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/x509_vfy.c:2197:1: return from a call to X509_STORE_CTX_free
  2195.       X509_STORE_CTX_cleanup(ctx);
  2196.       OPENSSL_free(ctx);
  2197. > }
  2198.   
  2199.   int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, X509 *x509,
