apps/ts.c:976: error: MEMORY_LEAK
  memory dynamically allocated by call to `TS_VERIFY_CTX_new()` at line 933, column 20 is not reachable after line 976, column 9.
Showing all 74 steps of the trace


apps/ts.c:920:1: start of procedure create_verify_ctx()
918.   }
919.   
920. > static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,
921.                                           char *queryfile,
922.                                           char *CApath, char *CAfile,

apps/ts.c:926:5: 
924.                                           X509_VERIFY_PARAM *vpm)
925.   {
926. >     TS_VERIFY_CTX *ctx = NULL;
927.       BIO *input = NULL;
928.       TS_REQ *request = NULL;

apps/ts.c:927:5: 
925.   {
926.       TS_VERIFY_CTX *ctx = NULL;
927. >     BIO *input = NULL;
928.       TS_REQ *request = NULL;
929.       int ret = 0;

apps/ts.c:928:5: 
926.       TS_VERIFY_CTX *ctx = NULL;
927.       BIO *input = NULL;
928. >     TS_REQ *request = NULL;
929.       int ret = 0;
930.       int f = 0;

apps/ts.c:929:5: 
927.       BIO *input = NULL;
928.       TS_REQ *request = NULL;
929. >     int ret = 0;
930.       int f = 0;
931.   

apps/ts.c:930:5: 
928.       TS_REQ *request = NULL;
929.       int ret = 0;
930. >     int f = 0;
931.   
932.       if (data != NULL || digest != NULL) {

apps/ts.c:932:9: Taking true branch
930.       int f = 0;
931.   
932.       if (data != NULL || digest != NULL) {
               ^
933.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
934.               goto err;

apps/ts.c:933:13: 
931.   
932.       if (data != NULL || digest != NULL) {
933. >         if ((ctx = TS_VERIFY_CTX_new()) == NULL)
934.               goto err;
935.           f = TS_VFY_VERSION | TS_VFY_SIGNER;

crypto/ts/ts_verify_ctx.c:64:1: start of procedure TS_VERIFY_CTX_new()
  62.   #include "ts_lcl.h"
  63.   
  64. > TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
  65.   {
  66.       TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));

crypto/ts/ts_verify_ctx.c:66:5: 
  64.   TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)
  65.   {
  66. >     TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  67.   
  68.       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/ts/ts_verify_ctx.c:68:9: Taking false branch
  66.       TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));
  67.   
  68.       if (ctx == NULL)
                ^
  69.           TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);
  70.       return ctx;

crypto/ts/ts_verify_ctx.c:70:5: 
  68.       if (ctx == NULL)
  69.           TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);
  70. >     return ctx;
  71.   }
  72.   

crypto/ts/ts_verify_ctx.c:71:1: return from a call to TS_VERIFY_CTX_new
  69.           TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);
  70.       return ctx;
  71. > }
  72.   
  73.   void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)

apps/ts.c:933:13: Taking false branch
931.   
932.       if (data != NULL || digest != NULL) {
933.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
                   ^
934.               goto err;
935.           f = TS_VFY_VERSION | TS_VFY_SIGNER;

apps/ts.c:935:9: 
933.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
934.               goto err;
935. >         f = TS_VFY_VERSION | TS_VFY_SIGNER;
936.           if (data != NULL) {
937.               f |= TS_VFY_DATA;

apps/ts.c:936:13: Taking true branch
934.               goto err;
935.           f = TS_VFY_VERSION | TS_VFY_SIGNER;
936.           if (data != NULL) {
                   ^
937.               f |= TS_VFY_DATA;
938.               if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)

apps/ts.c:937:13: 
935.           f = TS_VFY_VERSION | TS_VFY_SIGNER;
936.           if (data != NULL) {
937. >             f |= TS_VFY_DATA;
938.               if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)
939.                   goto err;

apps/ts.c:938:17: 
936.           if (data != NULL) {
937.               f |= TS_VFY_DATA;
938. >             if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)
939.                   goto err;
940.           } else if (digest != NULL) {

crypto/bio/bss_file.c:163:1: start of procedure BIO_new_file()
  161.   }
  162.   
  163. > BIO *BIO_new_file(const char *filename, const char *mode)
  164.   {
  165.       BIO  *ret;

crypto/bio/bss_file.c:166:5: 
  164.   {
  165.       BIO  *ret;
  166. >     FILE *file = file_fopen(filename, mode);
  167.       int fp_flags = BIO_CLOSE;
  168.   

crypto/bio/bss_file.c:112:1: start of procedure file_fopen()
    110.   };
    111.   
    112. > static FILE *file_fopen(const char *filename, const char *mode)
    113.   {
    114.       FILE *file = NULL;

crypto/bio/bss_file.c:114:5: 
    112.   static FILE *file_fopen(const char *filename, const char *mode)
    113.   {
    114. >     FILE *file = NULL;
    115.   
    116.   #  if defined(_WIN32) && defined(CP_UTF8)

crypto/bio/bss_file.c:158:5: 
    156.       }
    157.   #  else
    158. >     file = fopen(filename, mode);
    159.   #  endif
    160.       return (file);

crypto/bio/bss_file.c:160:5: 
    158.       file = fopen(filename, mode);
    159.   #  endif
    160. >     return (file);
    161.   }
    162.   

crypto/bio/bss_file.c:161:1: return from a call to file_fopen
    159.   #  endif
    160.       return (file);
    161. > }
    162.   
    163.   BIO *BIO_new_file(const char *filename, const char *mode)

crypto/bio/bss_file.c:167:5: 
  165.       BIO  *ret;
  166.       FILE *file = file_fopen(filename, mode);
  167. >     int fp_flags = BIO_CLOSE;
  168.   
  169.       if (strchr(mode, 'b') == NULL)

crypto/bio/bss_file.c:169:9: Taking false branch
  167.       int fp_flags = BIO_CLOSE;
  168.   
  169.       if (strchr(mode, 'b') == NULL)
                 ^
  170.           fp_flags |= BIO_FP_TEXT;
  171.   

crypto/bio/bss_file.c:172:9: Taking true branch
  170.           fp_flags |= BIO_FP_TEXT;
  171.   
  172.       if (file == NULL) {
                 ^
  173.           SYSerr(SYS_F_FOPEN, get_last_sys_error());
  174.           ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");

crypto/bio/bss_file.c:173:9: 
  171.   
  172.       if (file == NULL) {
  173. >         SYSerr(SYS_F_FOPEN, get_last_sys_error());
  174.           ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
  175.           if (errno == ENOENT)

crypto/bio/bss_file.c:174:9: 
  172.       if (file == NULL) {
  173.           SYSerr(SYS_F_FOPEN, get_last_sys_error());
  174. >         ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
  175.           if (errno == ENOENT)
  176.               BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE);

crypto/err/err.c:814:1: start of procedure ERR_add_error_data()
    812.   }
    813.   
    814. > void ERR_add_error_data(int num, ...)
    815.   {
    816.       va_list args;

crypto/err/err.c:817:5: 
    815.   {
    816.       va_list args;
    817. >     va_start(args, num);
    818.       ERR_add_error_vdata(num, args);
    819.       va_end(args);

crypto/err/err.c:818:5: Skipping ERR_add_error_vdata(): empty list of specs
    816.       va_list args;
    817.       va_start(args, num);
    818.       ERR_add_error_vdata(num, args);
               ^
    819.       va_end(args);
    820.   }

crypto/err/err.c:819:5: 
    817.       va_start(args, num);
    818.       ERR_add_error_vdata(num, args);
    819. >     va_end(args);
    820.   }
    821.   

crypto/err/err.c:820:1: return from a call to ERR_add_error_data
    818.       ERR_add_error_vdata(num, args);
    819.       va_end(args);
    820. > }
    821.   
    822.   void ERR_add_error_vdata(int num, va_list args)

crypto/bio/bss_file.c:175:13: Taking false branch
  173.           SYSerr(SYS_F_FOPEN, get_last_sys_error());
  174.           ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
  175.           if (errno == ENOENT)
                     ^
  176.               BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE);
  177.           else

crypto/bio/bss_file.c:178:13: Skipping ERR_put_error(): empty list of specs
  176.               BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE);
  177.           else
  178.               BIOerr(BIO_F_BIO_NEW_FILE, ERR_R_SYS_LIB);
                     ^
  179.           return (NULL);
  180.       }

crypto/bio/bss_file.c:179:9: 
  177.           else
  178.               BIOerr(BIO_F_BIO_NEW_FILE, ERR_R_SYS_LIB);
  179. >         return (NULL);
  180.       }
  181.       if ((ret = BIO_new(BIO_s_file())) == NULL) {

crypto/bio/bss_file.c:190:1: return from a call to BIO_new_file
  188.       BIO_set_fp(ret, file, fp_flags);
  189.       return (ret);
  190. > }
  191.   
  192.   BIO *BIO_new_fp(FILE *stream, int close_flag)

crypto/ts/ts_verify_ctx.c:100:1: start of procedure TS_VERIFY_CTX_set_data()
  98.   }
  99.   
  100. > BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *b)
  101.   {
  102.       ctx->data = b;

crypto/ts/ts_verify_ctx.c:102:5: 
  100.   BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *b)
  101.   {
  102. >     ctx->data = b;
  103.       return ctx->data;
  104.   }

crypto/ts/ts_verify_ctx.c:103:5: 
  101.   {
  102.       ctx->data = b;
  103. >     return ctx->data;
  104.   }
  105.   

crypto/ts/ts_verify_ctx.c:104:1: return from a call to TS_VERIFY_CTX_set_data
  102.       ctx->data = b;
  103.       return ctx->data;
  104. > }
  105.   
  106.   X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s)

apps/ts.c:938:17: Taking true branch
936.           if (data != NULL) {
937.               f |= TS_VFY_DATA;
938.               if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)
                       ^
939.                   goto err;
940.           } else if (digest != NULL) {

apps/ts.c:974:2: 
972.       ret = 1;
973.   
974. >  err:
975.       if (!ret) {
976.           TS_VERIFY_CTX_free(ctx);

apps/ts.c:975:10: Taking true branch
973.   
974.    err:
975.       if (!ret) {
                ^
976.           TS_VERIFY_CTX_free(ctx);
977.           ctx = NULL;

apps/ts.c:976:9: 
974.    err:
975.       if (!ret) {
976. >         TS_VERIFY_CTX_free(ctx);
977.           ctx = NULL;
978.       }

crypto/ts/ts_verify_ctx.c:79:1: start of procedure TS_VERIFY_CTX_free()
  77.   }
  78.   
  79. > void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)
  80.   {
  81.       if (!ctx)

crypto/ts/ts_verify_ctx.c:81:10: Taking false branch
  79.   void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)
  80.   {
  81.       if (!ctx)
                 ^
  82.           return;
  83.   

crypto/ts/ts_verify_ctx.c:84:5: Skipping TS_VERIFY_CTX_cleanup(): empty list of specs
  82.           return;
  83.   
  84.       TS_VERIFY_CTX_cleanup(ctx);
            ^
  85.       OPENSSL_free(ctx);
  86.   }

crypto/ts/ts_verify_ctx.c:85:5: 
  83.   
  84.       TS_VERIFY_CTX_cleanup(ctx);
  85. >     OPENSSL_free(ctx);
  86.   }
  87.   

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/ts/ts_verify_ctx.c:86:1: return from a call to TS_VERIFY_CTX_free
  84.       TS_VERIFY_CTX_cleanup(ctx);
  85.       OPENSSL_free(ctx);
  86. > }
  87.   
  88.   int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f)
