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


apps/ts.c:891:1: start of procedure create_verify_ctx()
889.   }
890.   
891. > static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,
892.                                           char *queryfile,
893.                                           char *CApath, char *CAfile,

apps/ts.c:896:5: 
894.                                           char *untrusted)
895.   {
896. >     TS_VERIFY_CTX *ctx = NULL;
897.       BIO *input = NULL;
898.       TS_REQ *request = NULL;

apps/ts.c:897:5: 
895.   {
896.       TS_VERIFY_CTX *ctx = NULL;
897. >     BIO *input = NULL;
898.       TS_REQ *request = NULL;
899.       int ret = 0;

apps/ts.c:898:5: 
896.       TS_VERIFY_CTX *ctx = NULL;
897.       BIO *input = NULL;
898. >     TS_REQ *request = NULL;
899.       int ret = 0;
900.       int f = 0;

apps/ts.c:899:5: 
897.       BIO *input = NULL;
898.       TS_REQ *request = NULL;
899. >     int ret = 0;
900.       int f = 0;
901.   

apps/ts.c:900:5: 
898.       TS_REQ *request = NULL;
899.       int ret = 0;
900. >     int f = 0;
901.   
902.       if (data != NULL || digest != NULL) {

apps/ts.c:902:9: Taking false branch
900.       int f = 0;
901.   
902.       if (data != NULL || digest != NULL) {
               ^
903.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
904.               goto err;

apps/ts.c:902:25: Taking true branch
900.       int f = 0;
901.   
902.       if (data != NULL || digest != NULL) {
                               ^
903.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
904.               goto err;

apps/ts.c:903:13: 
901.   
902.       if (data != NULL || digest != NULL) {
903. >         if ((ctx = TS_VERIFY_CTX_new()) == NULL)
904.               goto err;
905.           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:159:1: start of procedure CRYPTO_zalloc()
    157.   }
    158.   
    159. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    160.   {
    161.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:161:5: 
    159.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    160.   {
    161. >     void *ret = CRYPTO_malloc(num, file, line);
    162.   
    163.       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. >     (void)file;
      140.       (void)line;
      141.       ret = malloc(num);

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

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

crypto/mem.c:156:5: 
      154.   #endif
      155.   
      156. >     return ret;
      157.   }
      158.   

crypto/mem.c:157:1: return from a call to CRYPTO_malloc
      155.   
      156.       return ret;
      157. > }
      158.   
      159.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:163:9: Taking true branch
    161.       void *ret = CRYPTO_malloc(num, file, line);
    162.   
    163.       if (ret != NULL)
                   ^
    164.           memset(ret, 0, num);
    165.       return ret;

crypto/mem.c:164:9: 
    162.   
    163.       if (ret != NULL)
    164. >         memset(ret, 0, num);
    165.       return ret;
    166.   }

crypto/mem.c:165:5: 
    163.       if (ret != NULL)
    164.           memset(ret, 0, num);
    165. >     return ret;
    166.   }
    167.   

crypto/mem.c:166:1: return from a call to CRYPTO_zalloc
    164.           memset(ret, 0, num);
    165.       return ret;
    166. > }
    167.   
    168.   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:903:13: Taking false branch
901.   
902.       if (data != NULL || digest != NULL) {
903.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
                   ^
904.               goto err;
905.           f = TS_VFY_VERSION | TS_VFY_SIGNER;

apps/ts.c:905:9: 
903.           if ((ctx = TS_VERIFY_CTX_new()) == NULL)
904.               goto err;
905. >         f = TS_VFY_VERSION | TS_VFY_SIGNER;
906.           if (data != NULL) {
907.               f |= TS_VFY_DATA;

apps/ts.c:906:13: Taking false branch
904.               goto err;
905.           f = TS_VFY_VERSION | TS_VFY_SIGNER;
906.           if (data != NULL) {
                   ^
907.               f |= TS_VFY_DATA;
908.               if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)

apps/ts.c:910:20: Taking true branch
908.               if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)
909.                   goto err;
910.           } else if (digest != NULL) {
                          ^
911.               long imprint_len;
912.               unsigned char *hexstr = string_to_hex(digest, &imprint_len);

apps/ts.c:912:13: Skipping string_to_hex(): empty list of specs
910.           } else if (digest != NULL) {
911.               long imprint_len;
912.               unsigned char *hexstr = string_to_hex(digest, &imprint_len);
                   ^
913.               f |= TS_VFY_IMPRINT;
914.               if (TS_VERIFY_CTX_set_imprint(ctx, hexstr, imprint_len) == NULL) {

apps/ts.c:913:13: 
911.               long imprint_len;
912.               unsigned char *hexstr = string_to_hex(digest, &imprint_len);
913. >             f |= TS_VFY_IMPRINT;
914.               if (TS_VERIFY_CTX_set_imprint(ctx, hexstr, imprint_len) == NULL) {
915.                   BIO_printf(bio_err, "invalid digest string\n");

apps/ts.c:914:17: 
912.               unsigned char *hexstr = string_to_hex(digest, &imprint_len);
913.               f |= TS_VFY_IMPRINT;
914. >             if (TS_VERIFY_CTX_set_imprint(ctx, hexstr, imprint_len) == NULL) {
915.                   BIO_printf(bio_err, "invalid digest string\n");
916.                   goto err;

crypto/ts/ts_verify_ctx.c:119:1: start of procedure TS_VERIFY_CTX_set_imprint()
  117.   }
  118.   
  119. > unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
  120.                                            unsigned char *hexstr, long len)
  121.   {

crypto/ts/ts_verify_ctx.c:122:5: 
  120.                                            unsigned char *hexstr, long len)
  121.   {
  122. >     ctx->imprint = hexstr;
  123.       ctx->imprint_len = len;
  124.       return ctx->imprint;

crypto/ts/ts_verify_ctx.c:123:5: 
  121.   {
  122.       ctx->imprint = hexstr;
  123. >     ctx->imprint_len = len;
  124.       return ctx->imprint;
  125.   }

crypto/ts/ts_verify_ctx.c:124:5: 
  122.       ctx->imprint = hexstr;
  123.       ctx->imprint_len = len;
  124. >     return ctx->imprint;
  125.   }
  126.   

crypto/ts/ts_verify_ctx.c:125:1: return from a call to TS_VERIFY_CTX_set_imprint
  123.       ctx->imprint_len = len;
  124.       return ctx->imprint;
  125. > }
  126.   
  127.   void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)

apps/ts.c:914:17: Taking false branch
912.               unsigned char *hexstr = string_to_hex(digest, &imprint_len);
913.               f |= TS_VFY_IMPRINT;
914.               if (TS_VERIFY_CTX_set_imprint(ctx, hexstr, imprint_len) == NULL) {
                       ^
915.                   BIO_printf(bio_err, "invalid digest string\n");
916.                   goto err;

apps/ts.c:931:5: 
929.   
930.       /* Add the signature verification flag and arguments. */
931. >     TS_VERIFY_CTX_add_flags(ctx, f | TS_VFY_SIGNATURE);
932.   
933.       /* Initialising the X509_STORE object. */

crypto/ts/ts_verify_ctx.c:88:1: start of procedure TS_VERIFY_CTX_add_flags()
  86.   }
  87.   
  88. > int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f)
  89.   {
  90.       ctx->flags |= f;

crypto/ts/ts_verify_ctx.c:90:5: 
  88.   int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f)
  89.   {
  90. >     ctx->flags |= f;
  91.       return ctx->flags;
  92.   }

crypto/ts/ts_verify_ctx.c:91:5: 
  89.   {
  90.       ctx->flags |= f;
  91. >     return ctx->flags;
  92.   }
  93.   

crypto/ts/ts_verify_ctx.c:92:1: return from a call to TS_VERIFY_CTX_add_flags
  90.       ctx->flags |= f;
  91.       return ctx->flags;
  92. > }
  93.   
  94.   int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int f)

apps/ts.c:934:9: 
932.   
933.       /* Initialising the X509_STORE object. */
934. >     if (TS_VERIFY_CTX_set_store(ctx, create_cert_store(CApath, CAfile))
935.               == NULL)
936.           goto err;

apps/ts.c:954:1: start of procedure create_cert_store()
  952.   }
  953.   
  954. > static X509_STORE *create_cert_store(char *CApath, char *CAfile)
  955.   {
  956.       X509_STORE *cert_ctx = NULL;

apps/ts.c:956:5: 
  954.   static X509_STORE *create_cert_store(char *CApath, char *CAfile)
  955.   {
  956. >     X509_STORE *cert_ctx = NULL;
  957.       X509_LOOKUP *lookup = NULL;
  958.       int i;

apps/ts.c:957:5: 
  955.   {
  956.       X509_STORE *cert_ctx = NULL;
  957. >     X509_LOOKUP *lookup = NULL;
  958.       int i;
  959.   

apps/ts.c:960:5: Skipping X509_STORE_new(): empty list of specs
  958.       int i;
  959.   
  960.       cert_ctx = X509_STORE_new();
             ^
  961.       X509_STORE_set_verify_cb(cert_ctx, verify_cb);
  962.       if (CApath != NULL) {

apps/ts.c:961:5: 
  959.   
  960.       cert_ctx = X509_STORE_new();
  961. >     X509_STORE_set_verify_cb(cert_ctx, verify_cb);
  962.       if (CApath != NULL) {
  963.           lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());

crypto/x509/x509_lu.c:683:1: start of procedure X509_STORE_set_verify_cb()
    681.   }
    682.   
    683. > void X509_STORE_set_verify_cb(X509_STORE *ctx,
    684.                                 int (*verify_cb) (int, X509_STORE_CTX *))
    685.   {

crypto/x509/x509_lu.c:686:5: 
    684.                                 int (*verify_cb) (int, X509_STORE_CTX *))
    685.   {
    686. >     ctx->verify_cb = verify_cb;
    687.   }
    688.   

crypto/x509/x509_lu.c:687:1: return from a call to X509_STORE_set_verify_cb
    685.   {
    686.       ctx->verify_cb = verify_cb;
    687. > }
    688.   
    689.   void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,

apps/ts.c:962:9: Taking true branch
  960.       cert_ctx = X509_STORE_new();
  961.       X509_STORE_set_verify_cb(cert_ctx, verify_cb);
  962.       if (CApath != NULL) {
                 ^
  963.           lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
  964.           if (lookup == NULL) {

apps/ts.c:963:9: 
  961.       X509_STORE_set_verify_cb(cert_ctx, verify_cb);
  962.       if (CApath != NULL) {
  963. >         lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
  964.           if (lookup == NULL) {
  965.               BIO_printf(bio_err, "memory allocation failure\n");

crypto/x509/by_dir.c:113:1: start of procedure X509_LOOKUP_hash_dir()
    111.   };
    112.   
    113. > X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void)
    114.   {
    115.       return (&x509_dir_lookup);

crypto/x509/by_dir.c:115:5: 
    113.   X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void)
    114.   {
    115. >     return (&x509_dir_lookup);
    116.   }
    117.   

crypto/x509/by_dir.c:116:1: return from a call to X509_LOOKUP_hash_dir
    114.   {
    115.       return (&x509_dir_lookup);
    116. > }
    117.   
    118.   static int dir_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl,

crypto/x509/x509_lu.c:251:1: start of procedure X509_STORE_add_lookup()
    249.   }
    250.   
    251. > X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m)
    252.   {
    253.       int i;

crypto/x509/x509_lu.c:257:5: 
    255.       X509_LOOKUP *lu;
    256.   
    257. >     sk = v->get_cert_methods;
    258.       for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
    259.           lu = sk_X509_LOOKUP_value(sk, i);

crypto/x509/x509_lu.c:258:10: 
    256.   
    257.       sk = v->get_cert_methods;
    258. >     for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
    259.           lu = sk_X509_LOOKUP_value(sk, i);
    260.           if (m == lu->method) {

crypto/x509/x509_lu.c:258:17: 
    256.   
    257.       sk = v->get_cert_methods;
    258. >     for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
    259.           lu = sk_X509_LOOKUP_value(sk, i);
    260.           if (m == lu->method) {

include/openssl/x509_vfy.h:121:1: start of procedure sk_X509_LOOKUP_num()
      119.   typedef struct x509_lookup_st X509_LOOKUP;
      120.   
      121. > DEFINE_STACK_OF(X509_LOOKUP)
      122.   DEFINE_STACK_OF(X509_OBJECT)
      123.   

crypto/stack/stack.c:316:1: start of procedure sk_num()
        314.   }
        315.   
        316. > int sk_num(const _STACK *st)
        317.   {
        318.       if (st == NULL)

crypto/stack/stack.c:318:9: Taking true branch
        316.   int sk_num(const _STACK *st)
        317.   {
        318.       if (st == NULL)
                       ^
        319.           return -1;
        320.       return st->num;

crypto/stack/stack.c:319:9: 
        317.   {
        318.       if (st == NULL)
        319. >         return -1;
        320.       return st->num;
        321.   }

crypto/stack/stack.c:321:1: return from a call to sk_num
        319.           return -1;
        320.       return st->num;
        321. > }
        322.   
        323.   void *sk_value(const _STACK *st, int i)

include/openssl/x509_vfy.h:121:1: return from a call to sk_X509_LOOKUP_num
      119.   typedef struct x509_lookup_st X509_LOOKUP;
      120.   
      121. > DEFINE_STACK_OF(X509_LOOKUP)
      122.   DEFINE_STACK_OF(X509_OBJECT)
      123.   

crypto/x509/x509_lu.c:258:17: Loop condition is false. Leaving loop
    256.   
    257.       sk = v->get_cert_methods;
    258.       for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
                           ^
    259.           lu = sk_X509_LOOKUP_value(sk, i);
    260.           if (m == lu->method) {

crypto/x509/x509_lu.c:265:5: Skipping X509_LOOKUP_new(): empty list of specs
    263.       }
    264.       /* a new one */
    265.       lu = X509_LOOKUP_new(m);
               ^
    266.       if (lu == NULL)
    267.           return NULL;

crypto/x509/x509_lu.c:266:9: Taking true branch
    264.       /* a new one */
    265.       lu = X509_LOOKUP_new(m);
    266.       if (lu == NULL)
                   ^
    267.           return NULL;
    268.       else {

crypto/x509/x509_lu.c:267:9: 
    265.       lu = X509_LOOKUP_new(m);
    266.       if (lu == NULL)
    267. >         return NULL;
    268.       else {
    269.           lu->store_ctx = v;

crypto/x509/x509_lu.c:277:1: return from a call to X509_STORE_add_lookup
    275.           }
    276.       }
    277. > }
    278.   
    279.   int X509_STORE_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type,

apps/ts.c:964:13: Taking true branch
  962.       if (CApath != NULL) {
  963.           lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
  964.           if (lookup == NULL) {
                     ^
  965.               BIO_printf(bio_err, "memory allocation failure\n");
  966.               goto err;

apps/ts.c:965:13: 
  963.           lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());
  964.           if (lookup == NULL) {
  965. >             BIO_printf(bio_err, "memory allocation failure\n");
  966.               goto err;
  967.           }

crypto/bio/b_print.c:743:1: start of procedure BIO_printf()
    741.   /***************************************************************************/
    742.   
    743. > int BIO_printf(BIO *bio, const char *format, ...)
    744.   {
    745.       va_list args;

crypto/bio/b_print.c:748:5: 
    746.       int ret;
    747.   
    748. >     va_start(args, format);
    749.   
    750.       ret = BIO_vprintf(bio, format, args);

crypto/bio/b_print.c:750:5: Skipping BIO_vprintf(): empty list of specs
    748.       va_start(args, format);
    749.   
    750.       ret = BIO_vprintf(bio, format, args);
               ^
    751.   
    752.       va_end(args);

crypto/bio/b_print.c:752:5: 
    750.       ret = BIO_vprintf(bio, format, args);
    751.   
    752. >     va_end(args);
    753.       return (ret);
    754.   }

crypto/bio/b_print.c:753:5: 
    751.   
    752.       va_end(args);
    753. >     return (ret);
    754.   }
    755.   

crypto/bio/b_print.c:754:1: return from a call to BIO_printf
    752.       va_end(args);
    753.       return (ret);
    754. > }
    755.   
    756.   int BIO_vprintf(BIO *bio, const char *format, va_list args)

apps/ts.c:989:2: 
  987.       return cert_ctx;
  988.   
  989. >  err:
  990.       X509_STORE_free(cert_ctx);
  991.       return NULL;

apps/ts.c:990:5: 
  988.   
  989.    err:
  990. >     X509_STORE_free(cert_ctx);
  991.       return NULL;
  992.   }

crypto/x509/x509_lu.c:222:1: start of procedure X509_STORE_free()
    220.   }
    221.   
    222. > void X509_STORE_free(X509_STORE *vfy)
    223.   {
    224.       int i;

crypto/x509/x509_lu.c:228:9: Taking false branch
    226.       X509_LOOKUP *lu;
    227.   
    228.       if (vfy == NULL)
                   ^
    229.           return;
    230.   

crypto/x509/x509_lu.c:231:5: 
    229.           return;
    230.   
    231. >     i = CRYPTO_add(&vfy->references, -1, CRYPTO_LOCK_X509_STORE);
    232.       REF_PRINT_COUNT("X509_STORE", vfy);
    233.       if (i > 0)

crypto/lock.c:456:1: start of procedure CRYPTO_add_lock()
      454.   }
      455.   
      456. > int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,
      457.                       int line)
      458.   {

crypto/lock.c:459:5: 
      457.                       int line)
      458.   {
      459. >     int ret = 0;
      460.   
      461.       if (add_lock_callback != NULL) {

crypto/lock.c:461:9: Taking false branch
      459.       int ret = 0;
      460.   
      461.       if (add_lock_callback != NULL) {
                     ^
      462.   #ifdef LOCK_DEBUG
      463.           int before = *pointer;

crypto/lock.c:477:9: 
      475.   #endif
      476.       } else {
      477. >         CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
      478.   
      479.           ret = *pointer + amount;

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
        412.   }
        413.   
        414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
        415.   {
        416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
        439.       }
        440.   #endif
        441.       if (type < 0) {
                       ^
        442.           if (dynlock_lock_callback != NULL) {
        443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
        450.               CRYPTO_destroy_dynlockid(type);
        451.           }
        452.       } else if (locking_callback != NULL)
                              ^
        453.           locking_callback(mode, type, file, line);
        454.   }

crypto/lock.c:441:5: 
        439.       }
        440.   #endif
        441. >     if (type < 0) {
        442.           if (dynlock_lock_callback != NULL) {
        443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
        452.       } else if (locking_callback != NULL)
        453.           locking_callback(mode, type, file, line);
        454. > }
        455.   
        456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/lock.c:479:9: 
      477.           CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);
      478.   
      479. >         ret = *pointer + amount;
      480.   #ifdef LOCK_DEBUG
      481.           {

crypto/lock.c:490:9: 
      488.           }
      489.   #endif
      490. >         *pointer = ret;
      491.           CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
      492.       }

crypto/lock.c:491:9: 
      489.   #endif
      490.           *pointer = ret;
      491. >         CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
      492.       }
      493.       return (ret);

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
        412.   }
        413.   
        414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
        415.   {
        416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
        439.       }
        440.   #endif
        441.       if (type < 0) {
                       ^
        442.           if (dynlock_lock_callback != NULL) {
        443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
        450.               CRYPTO_destroy_dynlockid(type);
        451.           }
        452.       } else if (locking_callback != NULL)
                              ^
        453.           locking_callback(mode, type, file, line);
        454.   }

crypto/lock.c:441:5: 
        439.       }
        440.   #endif
        441. >     if (type < 0) {
        442.           if (dynlock_lock_callback != NULL) {
        443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
        452.       } else if (locking_callback != NULL)
        453.           locking_callback(mode, type, file, line);
        454. > }
        455.   
        456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/lock.c:493:5: 
      491.           CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);
      492.       }
      493. >     return (ret);
      494.   }
      495.   

crypto/lock.c:494:1: return from a call to CRYPTO_add_lock
      492.       }
      493.       return (ret);
      494. > }
      495.   
      496.   const char *CRYPTO_get_lock_name(int type)

crypto/x509/x509_lu.c:233:9: Taking false branch
    231.       i = CRYPTO_add(&vfy->references, -1, CRYPTO_LOCK_X509_STORE);
    232.       REF_PRINT_COUNT("X509_STORE", vfy);
    233.       if (i > 0)
                   ^
    234.           return;
    235.       REF_ASSERT_ISNT(i < 0);

crypto/x509/x509_lu.c:237:5: 
    235.       REF_ASSERT_ISNT(i < 0);
    236.   
    237. >     sk = vfy->get_cert_methods;
    238.       for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
    239.           lu = sk_X509_LOOKUP_value(sk, i);

crypto/x509/x509_lu.c:238:10: 
    236.   
    237.       sk = vfy->get_cert_methods;
    238. >     for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
    239.           lu = sk_X509_LOOKUP_value(sk, i);
    240.           X509_LOOKUP_shutdown(lu);

crypto/x509/x509_lu.c:238:17: 
    236.   
    237.       sk = vfy->get_cert_methods;
    238. >     for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
    239.           lu = sk_X509_LOOKUP_value(sk, i);
    240.           X509_LOOKUP_shutdown(lu);

include/openssl/x509_vfy.h:121:1: start of procedure sk_X509_LOOKUP_num()
      119.   typedef struct x509_lookup_st X509_LOOKUP;
      120.   
      121. > DEFINE_STACK_OF(X509_LOOKUP)
      122.   DEFINE_STACK_OF(X509_OBJECT)
      123.   

crypto/stack/stack.c:316:1: start of procedure sk_num()
        314.   }
        315.   
        316. > int sk_num(const _STACK *st)
        317.   {
        318.       if (st == NULL)

crypto/stack/stack.c:318:9: Taking true branch
        316.   int sk_num(const _STACK *st)
        317.   {
        318.       if (st == NULL)
                       ^
        319.           return -1;
        320.       return st->num;

crypto/stack/stack.c:319:9: 
        317.   {
        318.       if (st == NULL)
        319. >         return -1;
        320.       return st->num;
        321.   }

crypto/stack/stack.c:321:1: return from a call to sk_num
        319.           return -1;
        320.       return st->num;
        321. > }
        322.   
        323.   void *sk_value(const _STACK *st, int i)

include/openssl/x509_vfy.h:121:1: return from a call to sk_X509_LOOKUP_num
      119.   typedef struct x509_lookup_st X509_LOOKUP;
      120.   
      121. > DEFINE_STACK_OF(X509_LOOKUP)
      122.   DEFINE_STACK_OF(X509_OBJECT)
      123.   

crypto/x509/x509_lu.c:238:17: Loop condition is false. Leaving loop
    236.   
    237.       sk = vfy->get_cert_methods;
    238.       for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {
                           ^
    239.           lu = sk_X509_LOOKUP_value(sk, i);
    240.           X509_LOOKUP_shutdown(lu);

crypto/x509/x509_lu.c:243:5: 
    241.           X509_LOOKUP_free(lu);
    242.       }
    243. >     sk_X509_LOOKUP_free(sk);
    244.       sk_X509_OBJECT_pop_free(vfy->objs, cleanup);
    245.   

include/openssl/x509_vfy.h:121:1: start of procedure sk_X509_LOOKUP_free()
      119.   typedef struct x509_lookup_st X509_LOOKUP;
      120.   
      121. > DEFINE_STACK_OF(X509_LOOKUP)
      122.   DEFINE_STACK_OF(X509_OBJECT)
      123.   

crypto/stack/stack.c:308:1: start of procedure sk_free()
        306.   }
        307.   
        308. > void sk_free(_STACK *st)
        309.   {
        310.       if (st == NULL)

crypto/stack/stack.c:310:9: Taking true branch
        308.   void sk_free(_STACK *st)
        309.   {
        310.       if (st == NULL)
                       ^
        311.           return;
        312.       OPENSSL_free(st->data);

crypto/stack/stack.c:311:9: 
        309.   {
        310.       if (st == NULL)
        311. >         return;
        312.       OPENSSL_free(st->data);
        313.       OPENSSL_free(st);

crypto/stack/stack.c:314:1: return from a call to sk_free
        312.       OPENSSL_free(st->data);
        313.       OPENSSL_free(st);
        314. > }
        315.   
        316.   int sk_num(const _STACK *st)

include/openssl/x509_vfy.h:121:1: return from a call to sk_X509_LOOKUP_free
      119.   typedef struct x509_lookup_st X509_LOOKUP;
      120.   
      121. > DEFINE_STACK_OF(X509_LOOKUP)
      122.   DEFINE_STACK_OF(X509_OBJECT)
      123.   

crypto/x509/x509_lu.c:244:5: 
    242.       }
    243.       sk_X509_LOOKUP_free(sk);
    244. >     sk_X509_OBJECT_pop_free(vfy->objs, cleanup);
    245.   
    246.       CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);

include/openssl/x509_vfy.h:122:1: start of procedure sk_X509_OBJECT_pop_free()
      120.   
      121.   DEFINE_STACK_OF(X509_LOOKUP)
      122. > DEFINE_STACK_OF(X509_OBJECT)
      123.   
      124.   /* This is a static that defines the function interface */

include/openssl/x509_vfy.h:122:1: return from a call to sk_X509_OBJECT_pop_free
      120.   
      121.   DEFINE_STACK_OF(X509_LOOKUP)
      122. > DEFINE_STACK_OF(X509_OBJECT)
      123.   
      124.   /* This is a static that defines the function interface */

crypto/x509/x509_lu.c:246:5: 
    244.       sk_X509_OBJECT_pop_free(vfy->objs, cleanup);
    245.   
    246. >     CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);
    247.       X509_VERIFY_PARAM_free(vfy->param);
    248.       OPENSSL_free(vfy);

crypto/ex_data.c:373:1: start of procedure CRYPTO_free_ex_data()
      371.    * each index in the class used by this variable
      372.    */
      373. > void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)
      374.   {
      375.       int mx, i;

crypto/ex_data.c:379:5: 
      377.       void *ptr;
      378.       EX_CALLBACK *stack[10];
      379. >     EX_CALLBACK **storage = NULL;
      380.   
      381.       if ((ip = get_and_lock(class_index)) == NULL)

crypto/ex_data.c:381:9: 
      379.       EX_CALLBACK **storage = NULL;
      380.   
      381. >     if ((ip = get_and_lock(class_index)) == NULL)
      382.           return;
      383.   

crypto/ex_data.c:140:1: start of procedure get_and_lock()
        138.    * a given class.  On success, *holds the lock.*
        139.    */
        140. > static EX_CALLBACKS *get_and_lock(int class_index)
        141.   {
        142.       EX_CALLBACKS *ip;

crypto/ex_data.c:144:9: Taking false branch
        142.       EX_CALLBACKS *ip;
        143.   
        144.       if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
                       ^
        145.           CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);
        146.           return NULL;

crypto/ex_data.c:144:28: Taking false branch
        142.       EX_CALLBACKS *ip;
        143.   
        144.       if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
                                          ^
        145.           CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);
        146.           return NULL;

crypto/ex_data.c:149:5: 
        147.       }
        148.   
        149. >     ip = &ex_data[class_index];
        150.       CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);
        151.       if (ip->meth == NULL) {

crypto/ex_data.c:150:5: 
        148.   
        149.       ip = &ex_data[class_index];
        150. >     CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);
        151.       if (ip->meth == NULL) {
        152.           ip->meth = sk_EX_CALLBACK_new_null();

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
          412.   }
          413.   
          414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
          415.   {
          416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
          439.       }
          440.   #endif
          441.       if (type < 0) {
                         ^
          442.           if (dynlock_lock_callback != NULL) {
          443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
          450.               CRYPTO_destroy_dynlockid(type);
          451.           }
          452.       } else if (locking_callback != NULL)
                                ^
          453.           locking_callback(mode, type, file, line);
          454.   }

crypto/lock.c:441:5: 
          439.       }
          440.   #endif
          441. >     if (type < 0) {
          442.           if (dynlock_lock_callback != NULL) {
          443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
          452.       } else if (locking_callback != NULL)
          453.           locking_callback(mode, type, file, line);
          454. > }
          455.   
          456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/ex_data.c:151:9: Taking true branch
        149.       ip = &ex_data[class_index];
        150.       CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);
        151.       if (ip->meth == NULL) {
                       ^
        152.           ip->meth = sk_EX_CALLBACK_new_null();
        153.           /* We push an initial value on the stack because the SSL

crypto/ex_data.c:152:9: 
        150.       CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);
        151.       if (ip->meth == NULL) {
        152. >         ip->meth = sk_EX_CALLBACK_new_null();
        153.           /* We push an initial value on the stack because the SSL
        154.            * "app_data" routines use ex_data index zero.  See RT 3710. */

crypto/include/internal/cryptlib.h:83:1: start of procedure sk_EX_CALLBACK_new_null()
          81.   typedef struct ex_callback_st EX_CALLBACK;
          82.   
          83. > DEFINE_STACK_OF(EX_CALLBACK)
          84.   
          85.   DEFINE_STACK_OF(CRYPTO_dynlock)

crypto/stack/stack.c:144:1: start of procedure sk_new_null()
            142.   }
            143.   
            144. > _STACK *sk_new_null(void)
            145.   {
            146.       return sk_new((int (*)(const void *, const void *))0);

crypto/stack/stack.c:146:5: Skipping sk_new(): empty list of specs
            144.   _STACK *sk_new_null(void)
            145.   {
            146.       return sk_new((int (*)(const void *, const void *))0);
                       ^
            147.   }
            148.   

crypto/stack/stack.c:147:1: return from a call to sk_new_null
            145.   {
            146.       return sk_new((int (*)(const void *, const void *))0);
            147. > }
            148.   
            149.   _STACK *sk_new(int (*c) (const void *, const void *))

crypto/include/internal/cryptlib.h:83:1: return from a call to sk_EX_CALLBACK_new_null
          81.   typedef struct ex_callback_st EX_CALLBACK;
          82.   
          83. > DEFINE_STACK_OF(EX_CALLBACK)
          84.   
          85.   DEFINE_STACK_OF(CRYPTO_dynlock)

crypto/ex_data.c:155:13: Taking true branch
        153.           /* We push an initial value on the stack because the SSL
        154.            * "app_data" routines use ex_data index zero.  See RT 3710. */
        155.           if (ip->meth == NULL
                           ^
        156.               || !sk_EX_CALLBACK_push(ip->meth, NULL)) {
        157.               CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);

crypto/ex_data.c:157:13: Skipping ERR_put_error(): empty list of specs
        155.           if (ip->meth == NULL
        156.               || !sk_EX_CALLBACK_push(ip->meth, NULL)) {
        157.               CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);
                           ^
        158.               CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);
        159.               return NULL;

crypto/ex_data.c:158:13: 
        156.               || !sk_EX_CALLBACK_push(ip->meth, NULL)) {
        157.               CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);
        158. >             CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);
        159.               return NULL;
        160.           }

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
          412.   }
          413.   
          414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
          415.   {
          416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
          439.       }
          440.   #endif
          441.       if (type < 0) {
                         ^
          442.           if (dynlock_lock_callback != NULL) {
          443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking false branch
          450.               CRYPTO_destroy_dynlockid(type);
          451.           }
          452.       } else if (locking_callback != NULL)
                                ^
          453.           locking_callback(mode, type, file, line);
          454.   }

crypto/lock.c:441:5: 
          439.       }
          440.   #endif
          441. >     if (type < 0) {
          442.           if (dynlock_lock_callback != NULL) {
          443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
          452.       } else if (locking_callback != NULL)
          453.           locking_callback(mode, type, file, line);
          454. > }
          455.   
          456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/ex_data.c:159:13: 
        157.               CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);
        158.               CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);
        159. >             return NULL;
        160.           }
        161.       }

crypto/ex_data.c:163:1: return from a call to get_and_lock
        161.       }
        162.       return ip;
        163. > }
        164.   
        165.   static void cleanup_cb(EX_CALLBACK *funcs)

crypto/ex_data.c:381:9: Taking true branch
      379.       EX_CALLBACK **storage = NULL;
      380.   
      381.       if ((ip = get_and_lock(class_index)) == NULL)
                     ^
      382.           return;
      383.   

crypto/ex_data.c:382:9: 
      380.   
      381.       if ((ip = get_and_lock(class_index)) == NULL)
      382. >         return;
      383.   
      384.       mx = sk_EX_CALLBACK_num(ip->meth);

crypto/ex_data.c:412:1: return from a call to CRYPTO_free_ex_data
      410.       sk_void_free(ad->sk);
      411.       ad->sk = NULL;
      412. > }
      413.   
      414.   /*

crypto/x509/x509_lu.c:247:5: 
    245.   
    246.       CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);
    247. >     X509_VERIFY_PARAM_free(vfy->param);
    248.       OPENSSL_free(vfy);
    249.   }

crypto/x509/x509_vpm.c:168:1: start of procedure X509_VERIFY_PARAM_free()
      166.   }
      167.   
      168. > void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param)
      169.   {
      170.       if (!param)

crypto/x509/x509_vpm.c:170:10: Taking true branch
      168.   void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param)
      169.   {
      170.       if (!param)
                      ^
      171.           return;
      172.       x509_verify_param_zero(param);

crypto/x509/x509_vpm.c:171:9: 
      169.   {
      170.       if (!param)
      171. >         return;
      172.       x509_verify_param_zero(param);
      173.       OPENSSL_free(param);

crypto/x509/x509_vpm.c:174:1: return from a call to X509_VERIFY_PARAM_free
      172.       x509_verify_param_zero(param);
      173.       OPENSSL_free(param);
      174. > }
      175.   
      176.   /*-

crypto/x509/x509_lu.c:248:5: 
    246.       CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);
    247.       X509_VERIFY_PARAM_free(vfy->param);
    248. >     OPENSSL_free(vfy);
    249.   }
    250.   

crypto/mem.c:225:1: start of procedure CRYPTO_free()
      223.   }
      224.   
      225. > void CRYPTO_free(void *str, const char *file, int line)
      226.   {
      227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:227:9: Taking true branch
      225.   void CRYPTO_free(void *str, const char *file, int line)
      226.   {
      227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                     ^
      228.           free_impl(str, file, line);
      229.           return;

crypto/mem.c:227:30: Taking true branch
      225.   void CRYPTO_free(void *str, const char *file, int line)
      226.   {
      227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                          ^
      228.           free_impl(str, file, line);
      229.           return;

crypto/mem.c:228:9: Skipping __function_pointer__(): unresolved function pointer
      226.   {
      227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
      228.           free_impl(str, file, line);
                     ^
      229.           return;
      230.       }

crypto/mem.c:229:9: 
      227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
      228.           free_impl(str, file, line);
      229. >         return;
      230.       }
      231.   

crypto/mem.c:243:1: return from a call to CRYPTO_free
      241.       free(str);
      242.   #endif
      243. > }
      244.   
      245.   void CRYPTO_clear_free(void *str, size_t num, const char *file, int line)

crypto/x509/x509_lu.c:249:1: return from a call to X509_STORE_free
    247.       X509_VERIFY_PARAM_free(vfy->param);
    248.       OPENSSL_free(vfy);
    249. > }
    250.   
    251.   X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m)

apps/ts.c:991:5: 
  989.    err:
  990.       X509_STORE_free(cert_ctx);
  991. >     return NULL;
  992.   }
  993.   

apps/ts.c:992:1: return from a call to create_cert_store
  990.       X509_STORE_free(cert_ctx);
  991.       return NULL;
  992. > }
  993.   
  994.   static int verify_cb(int ok, X509_STORE_CTX *ctx)

crypto/ts/ts_verify_ctx.c:106:1: start of procedure TS_VERIFY_CTX_set_store()
  104.   }
  105.   
  106. > X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s)
  107.   {
  108.       ctx->store = s;

crypto/ts/ts_verify_ctx.c:108:5: 
  106.   X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s)
  107.   {
  108. >     ctx->store = s;
  109.       return ctx->store;
  110.   }

crypto/ts/ts_verify_ctx.c:109:5: 
  107.   {
  108.       ctx->store = s;
  109. >     return ctx->store;
  110.   }
  111.   

crypto/ts/ts_verify_ctx.c:110:1: return from a call to TS_VERIFY_CTX_set_store
  108.       ctx->store = s;
  109.       return ctx->store;
  110. > }
  111.   
  112.   STACK_OF(X509) *TS_VERIFY_CTS_set_certs(TS_VERIFY_CTX *ctx,

apps/ts.c:934:9: Taking true branch
932.   
933.       /* Initialising the X509_STORE object. */
934.       if (TS_VERIFY_CTX_set_store(ctx, create_cert_store(CApath, CAfile))
               ^
935.               == NULL)
936.           goto err;

apps/ts.c:944:2: 
942.       ret = 1;
943.   
944. >  err:
945.       if (!ret) {
946.           TS_VERIFY_CTX_free(ctx);

apps/ts.c:945:10: Taking true branch
943.   
944.    err:
945.       if (!ret) {
                ^
946.           TS_VERIFY_CTX_free(ctx);
947.           ctx = NULL;

apps/ts.c:946:9: 
944.    err:
945.       if (!ret) {
946. >         TS_VERIFY_CTX_free(ctx);
947.           ctx = NULL;
948.       }

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:225:1: start of procedure CRYPTO_free()
    223.   }
    224.   
    225. > void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {

crypto/mem.c:227:9: Taking true branch
    225.   void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                   ^
    228.           free_impl(str, file, line);
    229.           return;

crypto/mem.c:227:30: Taking true branch
    225.   void CRYPTO_free(void *str, const char *file, int line)
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
                                        ^
    228.           free_impl(str, file, line);
    229.           return;

crypto/mem.c:228:9: Skipping __function_pointer__(): unresolved function pointer
    226.   {
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    228.           free_impl(str, file, line);
                   ^
    229.           return;
    230.       }

crypto/mem.c:229:9: 
    227.       if (free_impl != NULL && free_impl != &CRYPTO_free) {
    228.           free_impl(str, file, line);
    229. >         return;
    230.       }
    231.   

crypto/mem.c:243:1: return from a call to CRYPTO_free
    241.       free(str);
    242.   #endif
    243. > }
    244.   
    245.   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)

static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,
                                        char *queryfile,
                                        char *CApath, char *CAfile,
                                        char *untrusted)
{
    TS_VERIFY_CTX *ctx = NULL;
    BIO *input = NULL;
    TS_REQ *request = NULL;
    int ret = 0;
    int f = 0;
    if (data != NULL || digest != NULL) {
        if ((ctx = TS_VERIFY_CTX_new()) == NULL)
            goto err;
        f = TS_VFY_VERSION | TS_VFY_SIGNER;
        if (data != NULL) {
            f |= TS_VFY_DATA;
            if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)
                goto err;
        } else if (digest != NULL) {
            long imprint_len;
            unsigned char *hexstr = string_to_hex(digest, &imprint_len);
            f |= TS_VFY_IMPRINT;
            if (TS_VERIFY_CTX_set_imprint(ctx, hexstr, imprint_len) == NULL) {
                BIO_printf(bio_err, "invalid digest string\n");
                goto err;
            }
        }
    } else if (queryfile != NULL) {
        if ((input = BIO_new_file(queryfile, "rb")) == NULL)
            goto err;
        if ((request = d2i_TS_REQ_bio(input, NULL)) == NULL)
            goto err;
        if ((ctx = TS_REQ_to_TS_VERIFY_CTX(request, NULL)) == NULL)
            goto err;
    } else
        return NULL;
    TS_VERIFY_CTX_add_flags(ctx, f | TS_VFY_SIGNATURE);
    if (TS_VERIFY_CTX_set_store(ctx, create_cert_store(CApath, CAfile))
            == NULL)
        goto err;
    if (untrusted
        && TS_VERIFY_CTS_set_certs(ctx, TS_CONF_load_certs(untrusted)) == NULL)
        goto err;
    ret = 1;
 err:
    if (!ret) {
        TS_VERIFY_CTX_free(ctx);
        ctx = NULL;
    }
    BIO_free_all(input);
    TS_REQ_free(request);
    return ctx;
}
['static TS_VERIFY_CTX *create_verify_ctx(char *data, char *digest,\n                                        char *queryfile,\n                                        char *CApath, char *CAfile,\n                                        char *untrusted)\n{\n    TS_VERIFY_CTX *ctx = NULL;\n    BIO *input = NULL;\n    TS_REQ *request = NULL;\n    int ret = 0;\n    int f = 0;\n    if (data != NULL || digest != NULL) {\n        if ((ctx = TS_VERIFY_CTX_new()) == NULL)\n            goto err;\n        f = TS_VFY_VERSION | TS_VFY_SIGNER;\n        if (data != NULL) {\n            f |= TS_VFY_DATA;\n            if (TS_VERIFY_CTX_set_data(ctx, BIO_new_file(data, "rb")) == NULL)\n                goto err;\n        } else if (digest != NULL) {\n            long imprint_len;\n            unsigned char *hexstr = string_to_hex(digest, &imprint_len);\n            f |= TS_VFY_IMPRINT;\n            if (TS_VERIFY_CTX_set_imprint(ctx, hexstr, imprint_len) == NULL) {\n                BIO_printf(bio_err, "invalid digest string\\n");\n                goto err;\n            }\n        }\n    } else if (queryfile != NULL) {\n        if ((input = BIO_new_file(queryfile, "rb")) == NULL)\n            goto err;\n        if ((request = d2i_TS_REQ_bio(input, NULL)) == NULL)\n            goto err;\n        if ((ctx = TS_REQ_to_TS_VERIFY_CTX(request, NULL)) == NULL)\n            goto err;\n    } else\n        return NULL;\n    TS_VERIFY_CTX_add_flags(ctx, f | TS_VFY_SIGNATURE);\n    if (TS_VERIFY_CTX_set_store(ctx, create_cert_store(CApath, CAfile))\n            == NULL)\n        goto err;\n    if (untrusted\n        && TS_VERIFY_CTS_set_certs(ctx, TS_CONF_load_certs(untrusted)) == NULL)\n        goto err;\n    ret = 1;\n err:\n    if (!ret) {\n        TS_VERIFY_CTX_free(ctx);\n        ctx = NULL;\n    }\n    BIO_free_all(input);\n    TS_REQ_free(request);\n    return ctx;\n}', 'TS_VERIFY_CTX *TS_VERIFY_CTX_new(void)\n{\n    TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx));\n    if (ctx == NULL)\n        TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE);\n    return ctx;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)\n        return malloc_impl(num, file, line);\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,\n                                         unsigned char *hexstr, long len)\n{\n    ctx->imprint = hexstr;\n    ctx->imprint_len = len;\n    return ctx->imprint;\n}', 'int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int f)\n{\n    ctx->flags |= f;\n    return ctx->flags;\n}', 'static X509_STORE *create_cert_store(char *CApath, char *CAfile)\n{\n    X509_STORE *cert_ctx = NULL;\n    X509_LOOKUP *lookup = NULL;\n    int i;\n    cert_ctx = X509_STORE_new();\n    X509_STORE_set_verify_cb(cert_ctx, verify_cb);\n    if (CApath != NULL) {\n        lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_hash_dir());\n        if (lookup == NULL) {\n            BIO_printf(bio_err, "memory allocation failure\\n");\n            goto err;\n        }\n        i = X509_LOOKUP_add_dir(lookup, CApath, X509_FILETYPE_PEM);\n        if (!i) {\n            BIO_printf(bio_err, "Error loading directory %s\\n", CApath);\n            goto err;\n        }\n    }\n    if (CAfile != NULL) {\n        lookup = X509_STORE_add_lookup(cert_ctx, X509_LOOKUP_file());\n        if (lookup == NULL) {\n            BIO_printf(bio_err, "memory allocation failure\\n");\n            goto err;\n        }\n        i = X509_LOOKUP_load_file(lookup, CAfile, X509_FILETYPE_PEM);\n        if (!i) {\n            BIO_printf(bio_err, "Error loading file %s\\n", CAfile);\n            goto err;\n        }\n    }\n    return cert_ctx;\n err:\n    X509_STORE_free(cert_ctx);\n    return NULL;\n}', 'void X509_STORE_set_verify_cb(X509_STORE *ctx,\n                              int (*verify_cb) (int, X509_STORE_CTX *))\n{\n    ctx->verify_cb = verify_cb;\n}', 'X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void)\n{\n    return (&x509_dir_lookup);\n}', 'X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m)\n{\n    int i;\n    STACK_OF(X509_LOOKUP) *sk;\n    X509_LOOKUP *lu;\n    sk = v->get_cert_methods;\n    for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {\n        lu = sk_X509_LOOKUP_value(sk, i);\n        if (m == lu->method) {\n            return lu;\n        }\n    }\n    lu = X509_LOOKUP_new(m);\n    if (lu == NULL)\n        return NULL;\n    else {\n        lu->store_ctx = v;\n        if (sk_X509_LOOKUP_push(v->get_cert_methods, lu))\n            return lu;\n        else {\n            X509_LOOKUP_free(lu);\n            return NULL;\n        }\n    }\n}', 'int sk_num(const _STACK *st)\n{\n    if (st == NULL)\n        return -1;\n    return st->num;\n}', 'int BIO_printf(BIO *bio, const char *format, ...)\n{\n    va_list args;\n    int ret;\n    va_start(args, format);\n    ret = BIO_vprintf(bio, format, args);\n    va_end(args);\n    return (ret);\n}', 'void X509_STORE_free(X509_STORE *vfy)\n{\n    int i;\n    STACK_OF(X509_LOOKUP) *sk;\n    X509_LOOKUP *lu;\n    if (vfy == NULL)\n        return;\n    i = CRYPTO_add(&vfy->references, -1, CRYPTO_LOCK_X509_STORE);\n    REF_PRINT_COUNT("X509_STORE", vfy);\n    if (i > 0)\n        return;\n    REF_ASSERT_ISNT(i < 0);\n    sk = vfy->get_cert_methods;\n    for (i = 0; i < sk_X509_LOOKUP_num(sk); i++) {\n        lu = sk_X509_LOOKUP_value(sk, i);\n        X509_LOOKUP_shutdown(lu);\n        X509_LOOKUP_free(lu);\n    }\n    sk_X509_LOOKUP_free(sk);\n    sk_X509_OBJECT_pop_free(vfy->objs, cleanup);\n    CRYPTO_free_ex_data(CRYPTO_EX_INDEX_X509_STORE, vfy, &vfy->ex_data);\n    X509_VERIFY_PARAM_free(vfy->param);\n    OPENSSL_free(vfy);\n}', 'int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,\n                    int line)\n{\n    int ret = 0;\n    if (add_lock_callback != NULL) {\n#ifdef LOCK_DEBUG\n        int before = *pointer;\n#endif\n        ret = add_lock_callback(pointer, amount, type, file, line);\n#ifdef LOCK_DEBUG\n        {\n            CRYPTO_THREADID id;\n            CRYPTO_THREADID_current(&id);\n            fprintf(stderr, "ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n                    CRYPTO_THREADID_hash(&id), before, amount, ret,\n                    CRYPTO_get_lock_name(type), file, line);\n        }\n#endif\n    } else {\n        CRYPTO_lock(CRYPTO_LOCK | CRYPTO_WRITE, type, file, line);\n        ret = *pointer + amount;\n#ifdef LOCK_DEBUG\n        {\n            CRYPTO_THREADID id;\n            CRYPTO_THREADID_current(&id);\n            fprintf(stderr, "ladd:%08lx:%2d+%2d->%2d %-18s %s:%d\\n",\n                    CRYPTO_THREADID_hash(&id),\n                    *pointer, amount, ret,\n                    CRYPTO_get_lock_name(type), file, line);\n        }\n#endif\n        *pointer = ret;\n        CRYPTO_lock(CRYPTO_UNLOCK | CRYPTO_WRITE, type, file, line);\n    }\n    return (ret);\n}', 'void CRYPTO_lock(int mode, int type, const char *file, int line)\n{\n#ifdef LOCK_DEBUG\n    {\n        CRYPTO_THREADID id;\n        char *rw_text, *operation_text;\n        if (mode & CRYPTO_LOCK)\n            operation_text = "lock  ";\n        else if (mode & CRYPTO_UNLOCK)\n            operation_text = "unlock";\n        else\n            operation_text = "ERROR ";\n        if (mode & CRYPTO_READ)\n            rw_text = "r";\n        else if (mode & CRYPTO_WRITE)\n            rw_text = "w";\n        else\n            rw_text = "ERROR";\n        CRYPTO_THREADID_current(&id);\n        fprintf(stderr, "lock:%08lx:(%s)%s %-18s %s:%d\\n",\n                CRYPTO_THREADID_hash(&id), rw_text, operation_text,\n                CRYPTO_get_lock_name(type), file, line);\n    }\n#endif\n    if (type < 0) {\n        if (dynlock_lock_callback != NULL) {\n            struct CRYPTO_dynlock_value *pointer\n                = CRYPTO_get_dynlock_value(type);\n            OPENSSL_assert(pointer != NULL);\n            dynlock_lock_callback(mode, pointer, file, line);\n            CRYPTO_destroy_dynlockid(type);\n        }\n    } else if (locking_callback != NULL)\n        locking_callback(mode, type, file, line);\n}', 'void sk_free(_STACK *st)\n{\n    if (st == NULL)\n        return;\n    OPENSSL_free(st->data);\n    OPENSSL_free(st);\n}', 'void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad)\n{\n    int mx, i;\n    EX_CALLBACKS *ip;\n    void *ptr;\n    EX_CALLBACK *stack[10];\n    EX_CALLBACK **storage = NULL;\n    if ((ip = get_and_lock(class_index)) == NULL)\n        return;\n    mx = sk_EX_CALLBACK_num(ip->meth);\n    if (mx > 0) {\n        if (mx < (int)OSSL_NELEM(stack))\n            storage = stack;\n        else\n            storage = OPENSSL_malloc(sizeof(*storage) * mx);\n        if (storage != NULL)\n            for (i = 0; i < mx; i++)\n                storage[i] = sk_EX_CALLBACK_value(ip->meth, i);\n    }\n    CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);\n    if (mx > 0 && storage == NULL) {\n        CRYPTOerr(CRYPTO_F_CRYPTO_FREE_EX_DATA, ERR_R_MALLOC_FAILURE);\n        return;\n    }\n    for (i = 0; i < mx; i++) {\n        if (storage[i] && storage[i]->free_func) {\n            ptr = CRYPTO_get_ex_data(ad, i);\n            storage[i]->free_func(obj, ptr, ad, i,\n                                  storage[i]->argl, storage[i]->argp);\n        }\n    }\n    if (storage != stack)\n        OPENSSL_free(storage);\n    sk_void_free(ad->sk);\n    ad->sk = NULL;\n}', 'static EX_CALLBACKS *get_and_lock(int class_index)\n{\n    EX_CALLBACKS *ip;\n    if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {\n        CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);\n        return NULL;\n    }\n    ip = &ex_data[class_index];\n    CRYPTO_w_lock(CRYPTO_LOCK_EX_DATA);\n    if (ip->meth == NULL) {\n        ip->meth = sk_EX_CALLBACK_new_null();\n        if (ip->meth == NULL\n            || !sk_EX_CALLBACK_push(ip->meth, NULL)) {\n            CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_MALLOC_FAILURE);\n            CRYPTO_w_unlock(CRYPTO_LOCK_EX_DATA);\n            return NULL;\n        }\n    }\n    return ip;\n}', 'DEFINE_STACK_OF(EX_CALLBACK)', '_STACK *sk_new_null(void)\n{\n    return sk_new((int (*)(const void *, const void *))0);\n}', 'void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param)\n{\n    if (!param)\n        return;\n    x509_verify_param_zero(param);\n    OPENSSL_free(param);\n}', 'void CRYPTO_free(void *str, const char *file, int line)\n{\n    if (free_impl != NULL && free_impl != &CRYPTO_free) {\n        free_impl(str, file, line);\n        return;\n    }\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0, file, line);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1, file, line);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}', 'X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *s)\n{\n    ctx->store = s;\n    return ctx->store;\n}', 'void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)\n{\n    if (!ctx)\n        return;\n    TS_VERIFY_CTX_cleanup(ctx);\n    OPENSSL_free(ctx);\n}']