crypto/ts/ts_verify_ctx.c:144: error: MEMORY_LEAK
  memory dynamically allocated by call to `TS_VERIFY_CTX_new()` at line 112, column 21 is not reachable after line 144, column 9.
Showing all 44 steps of the trace


crypto/ts/ts_verify_ctx.c:100:1: start of procedure TS_REQ_to_TS_VERIFY_CTX()
98.   }
99.   
100. > TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
101.   {
102.       TS_VERIFY_CTX *ret = ctx;

crypto/ts/ts_verify_ctx.c:102:5: 
100.   TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
101.   {
102. >     TS_VERIFY_CTX *ret = ctx;
103.       ASN1_OBJECT *policy;
104.       TS_MSG_IMPRINT *imprint;

crypto/ts/ts_verify_ctx.c:109:5: Condition is true
107.       const ASN1_INTEGER *nonce;
108.   
109.       OPENSSL_assert(req != NULL);
           ^
110.       if (ret)
111.           TS_VERIFY_CTX_cleanup(ret);

crypto/ts/ts_verify_ctx.c:110:9: Taking false branch
108.   
109.       OPENSSL_assert(req != NULL);
110.       if (ret)
               ^
111.           TS_VERIFY_CTX_cleanup(ret);
112.       else if ((ret = TS_VERIFY_CTX_new()) == NULL)

crypto/ts/ts_verify_ctx.c:112:14: 
110.       if (ret)
111.           TS_VERIFY_CTX_cleanup(ret);
112. >     else if ((ret = TS_VERIFY_CTX_new()) == NULL)
113.           return NULL;
114.   

crypto/ts/ts_verify_ctx.c:15:1: start of procedure TS_VERIFY_CTX_new()
  13.   #include "ts_lcl.h"
  14.   
  15. > TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
  16.   {
  17.       TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/ts/ts_verify_ctx.c:17:5: 
  15.   TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
  16.   {
  17. >     TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  18.   
  19.       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/ts/ts_verify_ctx.c:19:9: Taking false branch
  17.       TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  18.   
  19.       if (ctx == NULL)
                ^
  20.           TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);
  21.       return ctx;

crypto/ts/ts_verify_ctx.c:21:5: 
  19.       if (ctx == NULL)
  20.           TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);
  21. >     return ctx;
  22.   }
  23.   

crypto/ts/ts_verify_ctx.c:22:1: return from a call to TS_VERIFY_CTX_new
  20.           TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);
  21.       return ctx;
  22. > }
  23.   
  24.   void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)

crypto/ts/ts_verify_ctx.c:112:14: Taking false branch
110.       if (ret)
111.           TS_VERIFY_CTX_cleanup(ret);
112.       else if ((ret = TS_VERIFY_CTX_new()) == NULL)
                    ^
113.           return NULL;
114.   

crypto/ts/ts_verify_ctx.c:115:5: 
113.           return NULL;
114.   
115. >     ret->flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE);
116.   
117.       if ((policy = req->policy_id) != NULL) {

crypto/ts/ts_verify_ctx.c:117:9: Taking true branch
115.       ret->flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE);
116.   
117.       if ((policy = req->policy_id) != NULL) {
               ^
118.           if ((ret->policy = OBJ_dup(policy)) == NULL)
119.               goto err;

crypto/ts/ts_verify_ctx.c:118:13: Taking true branch
116.   
117.       if ((policy = req->policy_id) != NULL) {
118.           if ((ret->policy = OBJ_dup(policy)) == NULL)
                   ^
119.               goto err;
120.       } else

crypto/ts/ts_verify_ctx.c:140:2: 
138.   
139.       return ret;
140. >  err:
141.       if (ctx)
142.           TS_VERIFY_CTX_cleanup(ctx);

crypto/ts/ts_verify_ctx.c:141:9: Taking false branch
139.       return ret;
140.    err:
141.       if (ctx)
               ^
142.           TS_VERIFY_CTX_cleanup(ctx);
143.       else

crypto/ts/ts_verify_ctx.c:144:9: 
142.           TS_VERIFY_CTX_cleanup(ctx);
143.       else
144. >         TS_VERIFY_CTX_free(ret);
145.       return NULL;
146.   }

crypto/ts/ts_verify_ctx.c:30:1: start of procedure TS_VERIFY_CTX_free()
  28.   }
  29.   
  30. > void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)
  31.   {
  32.       if (!ctx)

crypto/ts/ts_verify_ctx.c:32:10: Taking false branch
  30.   void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)
  31.   {
  32.       if (!ctx)
                 ^
  33.           return;
  34.   

crypto/ts/ts_verify_ctx.c:35:5: Skipping TS_VERIFY_CTX_cleanup(): empty list of specs
  33.           return;
  34.   
  35.       TS_VERIFY_CTX_cleanup(ctx);
            ^
  36.       OPENSSL_free(ctx);
  37.   }

crypto/ts/ts_verify_ctx.c:36:5: 
  34.   
  35.       TS_VERIFY_CTX_cleanup(ctx);
  36. >     OPENSSL_free(ctx);
  37.   }
  38.   

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/ts/ts_verify_ctx.c:37:1: return from a call to TS_VERIFY_CTX_free
  35.       TS_VERIFY_CTX_cleanup(ctx);
  36.       OPENSSL_free(ctx);
  37. > }
  38.   
  39.   int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f)
