crypto/ts/ts_verify_ctx.c:193: error: MEMORY_LEAK
  memory dynamically allocated by call to `OBJ_dup()` at line 167, column 28 is not reachable after line 193, column 9.
Showing all 176 steps of the trace


crypto/ts/ts_verify_ctx.c:149:1: start of procedure TS_REQ_to_TS_VERIFY_CTX()
147.   }
148.   
149. > TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
150.   {
151.       TS_VERIFY_CTX *ret = ctx;

crypto/ts/ts_verify_ctx.c:151:5: 
149.   TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
150.   {
151. >     TS_VERIFY_CTX *ret = ctx;
152.       ASN1_OBJECT *policy;
153.       TS_MSG_IMPRINT *imprint;

crypto/ts/ts_verify_ctx.c:158:5: Condition is true
156.       const ASN1_INTEGER *nonce;
157.   
158.       OPENSSL_assert(req != NULL);
           ^
159.       if (ret)
160.           TS_VERIFY_CTX_cleanup(ret);

crypto/ts/ts_verify_ctx.c:159:9: Taking false branch
157.   
158.       OPENSSL_assert(req != NULL);
159.       if (ret)
               ^
160.           TS_VERIFY_CTX_cleanup(ret);
161.       else if ((ret = TS_VERIFY_CTX_new()) == NULL)

crypto/ts/ts_verify_ctx.c:161:14: 
159.       if (ret)
160.           TS_VERIFY_CTX_cleanup(ret);
161. >     else if ((ret = TS_VERIFY_CTX_new()) == NULL)
162.           return NULL;
163.   

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:156:1: start of procedure CRYPTO_zalloc()
    154.   }
    155.   
    156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
    156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
    157.   {
    158. >     void *ret = CRYPTO_malloc(num, file, line);
    159.   
    160.       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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
      121.       void *ret = NULL;
      122.   
      123.       if (num <= 0)
                     ^
      124.           return NULL;
      125.   

crypto/mem.c:126:5: 
      124.           return NULL;
      125.   
      126. >     allow_customize = 0;
      127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
      128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
      134.       }
      135.   #else
      136. >     (void)file;
      137.       (void)line;
      138.       ret = malloc(num);

crypto/mem.c:137:5: 
      135.   #else
      136.       (void)file;
      137. >     (void)line;
      138.       ret = malloc(num);
      139.   #endif

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

crypto/mem.c:153:5: 
      151.   #endif
      152.   
      153. >     return ret;
      154.   }
      155.   

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

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

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

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

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
    161.           memset(ret, 0, num);
    162.       return ret;
    163. > }
    164.   
    165.   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)

crypto/ts/ts_verify_ctx.c:161:14: Taking false branch
159.       if (ret)
160.           TS_VERIFY_CTX_cleanup(ret);
161.       else if ((ret = TS_VERIFY_CTX_new()) == NULL)
                    ^
162.           return NULL;
163.   

crypto/ts/ts_verify_ctx.c:164:5: 
162.           return NULL;
163.   
164. >     ret->flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE);
165.   
166.       if ((policy = req->policy_id) != NULL) {

crypto/ts/ts_verify_ctx.c:166:9: Taking true branch
164.       ret->flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE);
165.   
166.       if ((policy = req->policy_id) != NULL) {
               ^
167.           if ((ret->policy = OBJ_dup(policy)) == NULL)
168.               goto err;

crypto/ts/ts_verify_ctx.c:167:13: 
165.   
166.       if ((policy = req->policy_id) != NULL) {
167. >         if ((ret->policy = OBJ_dup(policy)) == NULL)
168.               goto err;
169.       } else

crypto/objects/obj_lib.c:65:1: start of procedure OBJ_dup()
  63.   #include "internal/asn1_int.h"
  64.   
  65. > ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)
  66.   {
  67.       ASN1_OBJECT *r;

crypto/objects/obj_lib.c:69:5: 
  67.       ASN1_OBJECT *r;
  68.       int i;
  69. >     char *ln = NULL, *sn = NULL;
  70.       unsigned char *data = NULL;
  71.   

crypto/objects/obj_lib.c:70:5: 
  68.       int i;
  69.       char *ln = NULL, *sn = NULL;
  70. >     unsigned char *data = NULL;
  71.   
  72.       if (o == NULL)

crypto/objects/obj_lib.c:72:9: Taking false branch
  70.       unsigned char *data = NULL;
  71.   
  72.       if (o == NULL)
                ^
  73.           return (NULL);
  74.       if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))

crypto/objects/obj_lib.c:74:11: Taking false branch
  72.       if (o == NULL)
  73.           return (NULL);
  74.       if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))
                  ^
  75.           return ((ASN1_OBJECT *)o); /* XXX: ugh! Why? What kind of duplication
  76.                                       * is this??? */

crypto/objects/obj_lib.c:78:5: 
  76.                                       * is this??? */
  77.   
  78. >     r = ASN1_OBJECT_new();
  79.       if (r == NULL) {
  80.           OBJerr(OBJ_F_OBJ_DUP, ERR_R_ASN1_LIB);

crypto/asn1/a_object.c:366:1: start of procedure ASN1_OBJECT_new()
    364.   }
    365.   
    366. > ASN1_OBJECT *ASN1_OBJECT_new(void)
    367.   {
    368.       ASN1_OBJECT *ret;

crypto/asn1/a_object.c:370:5: 
    368.       ASN1_OBJECT *ret;
    369.   
    370. >     ret = OPENSSL_zalloc(sizeof(*ret));
    371.       if (ret == NULL) {
    372.           ASN1err(ASN1_F_ASN1_OBJECT_NEW, ERR_R_MALLOC_FAILURE);

crypto/mem.c:156:1: start of procedure CRYPTO_zalloc()
      154.   }
      155.   
      156. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
      157.   {
      158.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:158:5: 
      156.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
      157.   {
      158. >     void *ret = CRYPTO_malloc(num, file, line);
      159.   
      160.       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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
        121.       void *ret = NULL;
        122.   
        123.       if (num <= 0)
                       ^
        124.           return NULL;
        125.   

crypto/mem.c:126:5: 
        124.           return NULL;
        125.   
        126. >     allow_customize = 0;
        127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
        128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
        134.       }
        135.   #else
        136. >     (void)file;
        137.       (void)line;
        138.       ret = malloc(num);

crypto/mem.c:137:5: 
        135.   #else
        136.       (void)file;
        137. >     (void)line;
        138.       ret = malloc(num);
        139.   #endif

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

crypto/mem.c:153:5: 
        151.   #endif
        152.   
        153. >     return ret;
        154.   }
        155.   

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

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

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

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

crypto/mem.c:163:1: return from a call to CRYPTO_zalloc
      161.           memset(ret, 0, num);
      162.       return ret;
      163. > }
      164.   
      165.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

crypto/asn1/a_object.c:371:9: Taking false branch
    369.   
    370.       ret = OPENSSL_zalloc(sizeof(*ret));
    371.       if (ret == NULL) {
                   ^
    372.           ASN1err(ASN1_F_ASN1_OBJECT_NEW, ERR_R_MALLOC_FAILURE);
    373.           return (NULL);

crypto/asn1/a_object.c:375:5: 
    373.           return (NULL);
    374.       }
    375. >     ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
    376.       return (ret);
    377.   }

crypto/asn1/a_object.c:376:5: 
    374.       }
    375.       ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
    376. >     return (ret);
    377.   }
    378.   

crypto/asn1/a_object.c:377:1: return from a call to ASN1_OBJECT_new
    375.       ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
    376.       return (ret);
    377. > }
    378.   
    379.   void ASN1_OBJECT_free(ASN1_OBJECT *a)

crypto/objects/obj_lib.c:79:9: Taking false branch
  77.   
  78.       r = ASN1_OBJECT_new();
  79.       if (r == NULL) {
                ^
  80.           OBJerr(OBJ_F_OBJ_DUP, ERR_R_ASN1_LIB);
  81.           return (NULL);

crypto/objects/obj_lib.c:83:5: 
  81.           return (NULL);
  82.       }
  83. >     data = OPENSSL_malloc(o->length);
  84.       if (data == NULL)
  85.           goto err;

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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

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

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

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

crypto/objects/obj_lib.c:84:9: Taking false branch
  82.       }
  83.       data = OPENSSL_malloc(o->length);
  84.       if (data == NULL)
                ^
  85.           goto err;
  86.       if (o->data != NULL)

crypto/objects/obj_lib.c:86:9: Taking true branch
  84.       if (data == NULL)
  85.           goto err;
  86.       if (o->data != NULL)
                ^
  87.           memcpy(data, o->data, o->length);
  88.       /* once data attached to object it remains const */

crypto/objects/obj_lib.c:87:9: 
  85.           goto err;
  86.       if (o->data != NULL)
  87. >         memcpy(data, o->data, o->length);
  88.       /* once data attached to object it remains const */
  89.       r->data = data;

crypto/objects/obj_lib.c:89:5: 
  87.           memcpy(data, o->data, o->length);
  88.       /* once data attached to object it remains const */
  89. >     r->data = data;
  90.       r->length = o->length;
  91.       r->nid = o->nid;

crypto/objects/obj_lib.c:90:5: 
  88.       /* once data attached to object it remains const */
  89.       r->data = data;
  90. >     r->length = o->length;
  91.       r->nid = o->nid;
  92.       r->ln = r->sn = NULL;

crypto/objects/obj_lib.c:91:5: 
  89.       r->data = data;
  90.       r->length = o->length;
  91. >     r->nid = o->nid;
  92.       r->ln = r->sn = NULL;
  93.       if (o->ln != NULL) {

crypto/objects/obj_lib.c:92:5: 
  90.       r->length = o->length;
  91.       r->nid = o->nid;
  92. >     r->ln = r->sn = NULL;
  93.       if (o->ln != NULL) {
  94.           i = strlen(o->ln) + 1;

crypto/objects/obj_lib.c:93:9: Taking true branch
  91.       r->nid = o->nid;
  92.       r->ln = r->sn = NULL;
  93.       if (o->ln != NULL) {
                ^
  94.           i = strlen(o->ln) + 1;
  95.           ln = OPENSSL_malloc(i);

crypto/objects/obj_lib.c:94:9: 
  92.       r->ln = r->sn = NULL;
  93.       if (o->ln != NULL) {
  94. >         i = strlen(o->ln) + 1;
  95.           ln = OPENSSL_malloc(i);
  96.           if (ln == NULL)

crypto/objects/obj_lib.c:95:9: 
  93.       if (o->ln != NULL) {
  94.           i = strlen(o->ln) + 1;
  95. >         ln = OPENSSL_malloc(i);
  96.           if (ln == NULL)
  97.               goto err;

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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

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

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

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

crypto/objects/obj_lib.c:96:13: Taking false branch
  94.           i = strlen(o->ln) + 1;
  95.           ln = OPENSSL_malloc(i);
  96.           if (ln == NULL)
                    ^
  97.               goto err;
  98.           memcpy(ln, o->ln, i);

crypto/objects/obj_lib.c:98:9: 
  96.           if (ln == NULL)
  97.               goto err;
  98. >         memcpy(ln, o->ln, i);
  99.           r->ln = ln;
  100.       }

crypto/objects/obj_lib.c:99:9: 
  97.               goto err;
  98.           memcpy(ln, o->ln, i);
  99. >         r->ln = ln;
  100.       }
  101.   

crypto/objects/obj_lib.c:102:9: Taking true branch
  100.       }
  101.   
  102.       if (o->sn != NULL) {
                 ^
  103.           i = strlen(o->sn) + 1;
  104.           sn = OPENSSL_malloc(i);

crypto/objects/obj_lib.c:103:9: 
  101.   
  102.       if (o->sn != NULL) {
  103. >         i = strlen(o->sn) + 1;
  104.           sn = OPENSSL_malloc(i);
  105.           if (sn == NULL)

crypto/objects/obj_lib.c:104:9: 
  102.       if (o->sn != NULL) {
  103.           i = strlen(o->sn) + 1;
  104. >         sn = OPENSSL_malloc(i);
  105.           if (sn == NULL)
  106.               goto err;

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 (num <= 0)

crypto/mem.c:123:9: Taking false branch
    121.       void *ret = NULL;
    122.   
    123.       if (num <= 0)
                   ^
    124.           return NULL;
    125.   

crypto/mem.c:126:5: 
    124.           return NULL;
    125.   
    126. >     allow_customize = 0;
    127.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
    128.       if (call_malloc_debug) {

crypto/mem.c:136:5: 
    134.       }
    135.   #else
    136. >     (void)file;
    137.       (void)line;
    138.       ret = malloc(num);

crypto/mem.c:137:5: 
    135.   #else
    136.       (void)file;
    137. >     (void)line;
    138.       ret = malloc(num);
    139.   #endif

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

crypto/mem.c:153:5: 
    151.   #endif
    152.   
    153. >     return ret;
    154.   }
    155.   

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

crypto/objects/obj_lib.c:105:13: Taking false branch
  103.           i = strlen(o->sn) + 1;
  104.           sn = OPENSSL_malloc(i);
  105.           if (sn == NULL)
                     ^
  106.               goto err;
  107.           memcpy(sn, o->sn, i);

crypto/objects/obj_lib.c:107:9: 
  105.           if (sn == NULL)
  106.               goto err;
  107. >         memcpy(sn, o->sn, i);
  108.           r->sn = sn;
  109.       }

crypto/objects/obj_lib.c:108:9: 
  106.               goto err;
  107.           memcpy(sn, o->sn, i);
  108. >         r->sn = sn;
  109.       }
  110.       r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |

crypto/objects/obj_lib.c:110:5: 
  108.           r->sn = sn;
  109.       }
  110. >     r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |
  111.                              ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
  112.                              ASN1_OBJECT_FLAG_DYNAMIC_DATA);

crypto/objects/obj_lib.c:113:5: 
  111.                              ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |
  112.                              ASN1_OBJECT_FLAG_DYNAMIC_DATA);
  113. >     return (r);
  114.    err:
  115.       OBJerr(OBJ_F_OBJ_DUP, ERR_R_MALLOC_FAILURE);

crypto/objects/obj_lib.c:121:1: return from a call to OBJ_dup
  119.       OPENSSL_free(r);
  120.       return (NULL);
  121. > }
  122.   
  123.   int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b)

crypto/ts/ts_verify_ctx.c:167:13: Taking false branch
165.   
166.       if ((policy = req->policy_id) != NULL) {
167.           if ((ret->policy = OBJ_dup(policy)) == NULL)
                   ^
168.               goto err;
169.       } else

crypto/ts/ts_verify_ctx.c:172:5: 
170.           ret->flags &= ~TS_VFY_POLICY;
171.   
172. >     imprint = req->msg_imprint;
173.       md_alg = imprint->hash_algo;
174.       if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)

crypto/ts/ts_verify_ctx.c:173:5: 
171.   
172.       imprint = req->msg_imprint;
173. >     md_alg = imprint->hash_algo;
174.       if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)
175.           goto err;

crypto/ts/ts_verify_ctx.c:174:9: 
172.       imprint = req->msg_imprint;
173.       md_alg = imprint->hash_algo;
174. >     if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)
175.           goto err;
176.       msg = imprint->hashed_msg;

crypto/asn1/x_algor.c:76:1: start of procedure X509_ALGOR_dup()
  74.   IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)
  75.   IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS)
  76. > IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)
  77.   
  78.   int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)

crypto/asn1/a_dup.c:97:1: start of procedure ASN1_item_dup()
    95.    */
    96.   
    97. > void *ASN1_item_dup(const ASN1_ITEM *it, void *x)
    98.   {
    99.       unsigned char *b = NULL;

crypto/asn1/a_dup.c:99:5: 
    97.   void *ASN1_item_dup(const ASN1_ITEM *it, void *x)
    98.   {
    99. >     unsigned char *b = NULL;
    100.       const unsigned char *p;
    101.       long i;

crypto/asn1/a_dup.c:104:9: Taking true branch
    102.       void *ret;
    103.   
    104.       if (x == NULL)
                   ^
    105.           return (NULL);
    106.   

crypto/asn1/a_dup.c:105:9: 
    103.   
    104.       if (x == NULL)
    105. >         return (NULL);
    106.   
    107.       i = ASN1_item_i2d(x, &b, it);

crypto/asn1/a_dup.c:116:1: return from a call to ASN1_item_dup
    114.       OPENSSL_free(b);
    115.       return (ret);
    116. > }

crypto/asn1/x_algor.c:76:1: return from a call to X509_ALGOR_dup
  74.   IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)
  75.   IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS)
  76. > IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)
  77.   
  78.   int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)

crypto/ts/ts_verify_ctx.c:174:9: Taking true branch
172.       imprint = req->msg_imprint;
173.       md_alg = imprint->hash_algo;
174.       if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)
               ^
175.           goto err;
176.       msg = imprint->hashed_msg;

crypto/ts/ts_verify_ctx.c:189:2: 
187.   
188.       return ret;
189. >  err:
190.       if (ctx)
191.           TS_VERIFY_CTX_cleanup(ctx);

crypto/ts/ts_verify_ctx.c:190:9: Taking false branch
188.       return ret;
189.    err:
190.       if (ctx)
               ^
191.           TS_VERIFY_CTX_cleanup(ctx);
192.       else

crypto/ts/ts_verify_ctx.c:193:9: 
191.           TS_VERIFY_CTX_cleanup(ctx);
192.       else
193. >         TS_VERIFY_CTX_free(ret);
194.       return NULL;
195.   }

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: 
  82.           return;
  83.   
  84. >     TS_VERIFY_CTX_cleanup(ctx);
  85.       OPENSSL_free(ctx);
  86.   }

crypto/ts/ts_verify_ctx.c:127:1: start of procedure TS_VERIFY_CTX_cleanup()
    125.   }
    126.   
    127. > void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)
    128.   {
    129.       if (!ctx)

crypto/ts/ts_verify_ctx.c:129:10: Taking false branch
    127.   void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)
    128.   {
    129.       if (!ctx)
                    ^
    130.           return;
    131.   

crypto/ts/ts_verify_ctx.c:132:5: 
    130.           return;
    131.   
    132. >     X509_STORE_free(ctx->store);
    133.       sk_X509_pop_free(ctx->certs, X509_free);
    134.   

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 true branch
      226.       X509_LOOKUP *lu;
      227.   
      228.       if (vfy == NULL)
                     ^
      229.           return;
      230.   

crypto/x509/x509_lu.c:229:9: 
      227.   
      228.       if (vfy == NULL)
      229. >         return;
      230.   
      231.       i = CRYPTO_add(&vfy->references, -1, CRYPTO_LOCK_X509_STORE);

crypto/x509/x509_lu.c:256:1: return from a call to X509_STORE_free
      254.       X509_VERIFY_PARAM_free(vfy->param);
      255.       OPENSSL_free(vfy);
      256. > }
      257.   
      258.   X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m)

crypto/ts/ts_verify_ctx.c:133:5: 
    131.   
    132.       X509_STORE_free(ctx->store);
    133. >     sk_X509_pop_free(ctx->certs, X509_free);
    134.   
    135.       ASN1_OBJECT_free(ctx->policy);

include/openssl/x509.h:169:1: start of procedure sk_X509_pop_free()
      167.   typedef struct x509_cinf_st X509_CINF;
      168.   
      169. > DEFINE_STACK_OF(X509)
      170.   
      171.   /* This is used for a table of trust checking functions */

include/openssl/x509.h:169:1: return from a call to sk_X509_pop_free
      167.   typedef struct x509_cinf_st X509_CINF;
      168.   
      169. > DEFINE_STACK_OF(X509)
      170.   
      171.   /* This is used for a table of trust checking functions */

crypto/ts/ts_verify_ctx.c:135:5: Skipping ASN1_OBJECT_free(): empty list of specs
    133.       sk_X509_pop_free(ctx->certs, X509_free);
    134.   
    135.       ASN1_OBJECT_free(ctx->policy);
               ^
    136.   
    137.       X509_ALGOR_free(ctx->md_alg);

crypto/ts/ts_verify_ctx.c:137:5: 
    135.       ASN1_OBJECT_free(ctx->policy);
    136.   
    137. >     X509_ALGOR_free(ctx->md_alg);
    138.       OPENSSL_free(ctx->imprint);
    139.   

crypto/asn1/x_algor.c:74:1: start of procedure X509_ALGOR_free()
      72.   ASN1_ITEM_TEMPLATE_END(X509_ALGORS)
      73.   
      74. > IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)
      75.   IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS)
      76.   IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)

crypto/asn1/tasn_fre.c:70:1: start of procedure ASN1_item_free()
        68.   /* Free up an ASN1 structure */
        69.   
        70. > void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
        71.   {
        72.       asn1_item_embed_free(&val, it, 0);

crypto/asn1/tasn_fre.c:72:5: Skipping asn1_item_embed_free(): empty list of specs
        70.   void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
        71.   {
        72.       asn1_item_embed_free(&val, it, 0);
                  ^
        73.   }
        74.   

crypto/asn1/tasn_fre.c:73:1: return from a call to ASN1_item_free
        71.   {
        72.       asn1_item_embed_free(&val, it, 0);
        73. > }
        74.   
        75.   void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)

crypto/asn1/x_algor.c:74:1: return from a call to X509_ALGOR_free
      72.   ASN1_ITEM_TEMPLATE_END(X509_ALGORS)
      73.   
      74. > IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)
      75.   IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS)
      76.   IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)

crypto/ts/ts_verify_ctx.c:138:5: 
    136.   
    137.       X509_ALGOR_free(ctx->md_alg);
    138. >     OPENSSL_free(ctx->imprint);
    139.   
    140.       BIO_free_all(ctx->data);

crypto/mem.c:233:1: start of procedure CRYPTO_free()
      231.   }
      232.   
      233. > void CRYPTO_free(void *str)
      234.   {
      235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
      242.       }
      243.   #else
      244. >     free(str);
      245.   #endif
      246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
      244.       free(str);
      245.   #endif
      246. > }
      247.   
      248.   void CRYPTO_clear_free(void *str, size_t num)

crypto/ts/ts_verify_ctx.c:140:5: 
    138.       OPENSSL_free(ctx->imprint);
    139.   
    140. >     BIO_free_all(ctx->data);
    141.   
    142.       ASN1_INTEGER_free(ctx->nonce);

crypto/bio/bio_lib.c:498:1: start of procedure BIO_free_all()
      496.   }
      497.   
      498. > void BIO_free_all(BIO *bio)
      499.   {
      500.       BIO *b;

crypto/bio/bio_lib.c:503:12: Loop condition is false. Leaving loop
      501.       int ref;
      502.   
      503.       while (bio != NULL) {
                        ^
      504.           b = bio;
      505.           ref = b->references;

crypto/bio/bio_lib.c:512:1: return from a call to BIO_free_all
      510.               break;
      511.       }
      512. > }
      513.   
      514.   BIO *BIO_dup_chain(BIO *in)

crypto/ts/ts_verify_ctx.c:142:5: 
    140.       BIO_free_all(ctx->data);
    141.   
    142. >     ASN1_INTEGER_free(ctx->nonce);
    143.   
    144.       GENERAL_NAME_free(ctx->tsa_name);

crypto/asn1/tasn_typ.c:77:1: start of procedure ASN1_INTEGER_free()
      75.   
      76.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
      77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
      78.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
      79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)

crypto/asn1/asn1_lib.c:361:1: start of procedure ASN1_STRING_free()
        359.   }
        360.   
        361. > void ASN1_STRING_free(ASN1_STRING *a)
        362.   {
        363.       if (a == NULL)

crypto/asn1/asn1_lib.c:363:9: Taking false branch
        361.   void ASN1_STRING_free(ASN1_STRING *a)
        362.   {
        363.       if (a == NULL)
                       ^
        364.           return;
        365.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))

crypto/asn1/asn1_lib.c:365:11: Taking false branch
        363.       if (a == NULL)
        364.           return;
        365.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
                         ^
        366.           OPENSSL_free(a->data);
        367.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))

crypto/asn1/asn1_lib.c:367:11: Taking false branch
        365.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
        366.           OPENSSL_free(a->data);
        367.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
                         ^
        368.           OPENSSL_free(a);
        369.   }

crypto/asn1/asn1_lib.c:367:5: 
        365.       if (!(a->flags & ASN1_STRING_FLAG_NDEF))
        366.           OPENSSL_free(a->data);
        367. >     if (!(a->flags & ASN1_STRING_FLAG_EMBED))
        368.           OPENSSL_free(a);
        369.   }

crypto/asn1/asn1_lib.c:369:1: return from a call to ASN1_STRING_free
        367.       if (!(a->flags & ASN1_STRING_FLAG_EMBED))
        368.           OPENSSL_free(a);
        369. > }
        370.   
        371.   void ASN1_STRING_clear_free(ASN1_STRING *a)

crypto/asn1/tasn_typ.c:77:1: return from a call to ASN1_INTEGER_free
      75.   
      76.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_OCTET_STRING)
      77. > IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)
      78.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_ENUMERATED)
      79.   IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_BIT_STRING)

crypto/ts/ts_verify_ctx.c:144:5: 
    142.       ASN1_INTEGER_free(ctx->nonce);
    143.   
    144. >     GENERAL_NAME_free(ctx->tsa_name);
    145.   
    146.       TS_VERIFY_CTX_init(ctx);

crypto/x509v3/v3_genn.c:94:1: start of procedure GENERAL_NAME_free()
      92.   } ASN1_CHOICE_END(GENERAL_NAME)
      93.   
      94. > IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME)
      95.   
      96.   ASN1_ITEM_TEMPLATE(GENERAL_NAMES) =

crypto/asn1/tasn_fre.c:70:1: start of procedure ASN1_item_free()
        68.   /* Free up an ASN1 structure */
        69.   
        70. > void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
        71.   {
        72.       asn1_item_embed_free(&val, it, 0);

crypto/asn1/tasn_fre.c:72:5: Skipping asn1_item_embed_free(): empty list of specs
        70.   void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)
        71.   {
        72.       asn1_item_embed_free(&val, it, 0);
                  ^
        73.   }
        74.   

crypto/asn1/tasn_fre.c:73:1: return from a call to ASN1_item_free
        71.   {
        72.       asn1_item_embed_free(&val, it, 0);
        73. > }
        74.   
        75.   void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it)

crypto/x509v3/v3_genn.c:94:1: return from a call to GENERAL_NAME_free
      92.   } ASN1_CHOICE_END(GENERAL_NAME)
      93.   
      94. > IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME)
      95.   
      96.   ASN1_ITEM_TEMPLATE(GENERAL_NAMES) =

crypto/ts/ts_verify_ctx.c:146:5: 
    144.       GENERAL_NAME_free(ctx->tsa_name);
    145.   
    146. >     TS_VERIFY_CTX_init(ctx);
    147.   }
    148.   

crypto/ts/ts_verify_ctx.c:73:1: start of procedure TS_VERIFY_CTX_init()
      71.   }
      72.   
      73. > void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)
      74.   {
      75.       OPENSSL_assert(ctx != NULL);

crypto/ts/ts_verify_ctx.c:75:5: Condition is true
      73.   void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)
      74.   {
      75.       OPENSSL_assert(ctx != NULL);
                ^
      76.       memset(ctx, 0, sizeof(*ctx));
      77.   }

crypto/ts/ts_verify_ctx.c:76:5: 
      74.   {
      75.       OPENSSL_assert(ctx != NULL);
      76. >     memset(ctx, 0, sizeof(*ctx));
      77.   }
      78.   

crypto/ts/ts_verify_ctx.c:77:1: return from a call to TS_VERIFY_CTX_init
      75.       OPENSSL_assert(ctx != NULL);
      76.       memset(ctx, 0, sizeof(*ctx));
      77. > }
      78.   
      79.   void TS_VERIFY_CTX_free(TS_VERIFY_CTX *ctx)

crypto/ts/ts_verify_ctx.c:147:1: return from a call to TS_VERIFY_CTX_cleanup
    145.   
    146.       TS_VERIFY_CTX_init(ctx);
    147. > }
    148.   
    149.   TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)

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

crypto/mem.c:233:1: start of procedure CRYPTO_free()
    231.   }
    232.   
    233. > void CRYPTO_free(void *str)
    234.   {
    235.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG

crypto/mem.c:244:5: 
    242.       }
    243.   #else
    244. >     free(str);
    245.   #endif
    246.   }

crypto/mem.c:246:1: return from a call to CRYPTO_free
    244.       free(str);
    245.   #endif
    246. > }
    247.   
    248.   void CRYPTO_clear_free(void *str, size_t num)

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)

TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)
{
    TS_VERIFY_CTX *ret = ctx;
    ASN1_OBJECT *policy;
    TS_MSG_IMPRINT *imprint;
    X509_ALGOR *md_alg;
    ASN1_OCTET_STRING *msg;
    const ASN1_INTEGER *nonce;
    OPENSSL_assert(req != NULL);
    if (ret)
        TS_VERIFY_CTX_cleanup(ret);
    else if ((ret = TS_VERIFY_CTX_new()) == NULL)
        return NULL;
    ret->flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE);
    if ((policy = req->policy_id) != NULL) {
        if ((ret->policy = OBJ_dup(policy)) == NULL)
            goto err;
    } else
        ret->flags &= ~TS_VFY_POLICY;
    imprint = req->msg_imprint;
    md_alg = imprint->hash_algo;
    if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)
        goto err;
    msg = imprint->hashed_msg;
    ret->imprint_len = ASN1_STRING_length(msg);
    if ((ret->imprint = OPENSSL_malloc(ret->imprint_len)) == NULL)
        goto err;
    memcpy(ret->imprint, ASN1_STRING_data(msg), ret->imprint_len);
    if ((nonce = req->nonce) != NULL) {
        if ((ret->nonce = ASN1_INTEGER_dup(nonce)) == NULL)
            goto err;
    } else
        ret->flags &= ~TS_VFY_NONCE;
    return ret;
 err:
    if (ctx)
        TS_VERIFY_CTX_cleanup(ctx);
    else
        TS_VERIFY_CTX_free(ret);
    return NULL;
}
['TS_VERIFY_CTX *TS_REQ_to_TS_VERIFY_CTX(TS_REQ *req, TS_VERIFY_CTX *ctx)\n{\n    TS_VERIFY_CTX *ret = ctx;\n    ASN1_OBJECT *policy;\n    TS_MSG_IMPRINT *imprint;\n    X509_ALGOR *md_alg;\n    ASN1_OCTET_STRING *msg;\n    const ASN1_INTEGER *nonce;\n    OPENSSL_assert(req != NULL);\n    if (ret)\n        TS_VERIFY_CTX_cleanup(ret);\n    else if ((ret = TS_VERIFY_CTX_new()) == NULL)\n        return NULL;\n    ret->flags = TS_VFY_ALL_IMPRINT & ~(TS_VFY_TSA_NAME | TS_VFY_SIGNATURE);\n    if ((policy = req->policy_id) != NULL) {\n        if ((ret->policy = OBJ_dup(policy)) == NULL)\n            goto err;\n    } else\n        ret->flags &= ~TS_VFY_POLICY;\n    imprint = req->msg_imprint;\n    md_alg = imprint->hash_algo;\n    if ((ret->md_alg = X509_ALGOR_dup(md_alg)) == NULL)\n        goto err;\n    msg = imprint->hashed_msg;\n    ret->imprint_len = ASN1_STRING_length(msg);\n    if ((ret->imprint = OPENSSL_malloc(ret->imprint_len)) == NULL)\n        goto err;\n    memcpy(ret->imprint, ASN1_STRING_data(msg), ret->imprint_len);\n    if ((nonce = req->nonce) != NULL) {\n        if ((ret->nonce = ASN1_INTEGER_dup(nonce)) == NULL)\n            goto err;\n    } else\n        ret->flags &= ~TS_VFY_NONCE;\n    return ret;\n err:\n    if (ctx)\n        TS_VERIFY_CTX_cleanup(ctx);\n    else\n        TS_VERIFY_CTX_free(ret);\n    return NULL;\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 (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}', 'ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o)\n{\n    ASN1_OBJECT *r;\n    int i;\n    char *ln = NULL, *sn = NULL;\n    unsigned char *data = NULL;\n    if (o == NULL)\n        return (NULL);\n    if (!(o->flags & ASN1_OBJECT_FLAG_DYNAMIC))\n        return ((ASN1_OBJECT *)o);\n    r = ASN1_OBJECT_new();\n    if (r == NULL) {\n        OBJerr(OBJ_F_OBJ_DUP, ERR_R_ASN1_LIB);\n        return (NULL);\n    }\n    data = OPENSSL_malloc(o->length);\n    if (data == NULL)\n        goto err;\n    if (o->data != NULL)\n        memcpy(data, o->data, o->length);\n    r->data = data;\n    r->length = o->length;\n    r->nid = o->nid;\n    r->ln = r->sn = NULL;\n    if (o->ln != NULL) {\n        i = strlen(o->ln) + 1;\n        ln = OPENSSL_malloc(i);\n        if (ln == NULL)\n            goto err;\n        memcpy(ln, o->ln, i);\n        r->ln = ln;\n    }\n    if (o->sn != NULL) {\n        i = strlen(o->sn) + 1;\n        sn = OPENSSL_malloc(i);\n        if (sn == NULL)\n            goto err;\n        memcpy(sn, o->sn, i);\n        r->sn = sn;\n    }\n    r->flags = o->flags | (ASN1_OBJECT_FLAG_DYNAMIC |\n                           ASN1_OBJECT_FLAG_DYNAMIC_STRINGS |\n                           ASN1_OBJECT_FLAG_DYNAMIC_DATA);\n    return (r);\n err:\n    OBJerr(OBJ_F_OBJ_DUP, ERR_R_MALLOC_FAILURE);\n    OPENSSL_free(ln);\n    OPENSSL_free(sn);\n    OPENSSL_free(data);\n    OPENSSL_free(r);\n    return (NULL);\n}', 'ASN1_OBJECT *ASN1_OBJECT_new(void)\n{\n    ASN1_OBJECT *ret;\n    ret = OPENSSL_zalloc(sizeof(*ret));\n    if (ret == NULL) {\n        ASN1err(ASN1_F_ASN1_OBJECT_NEW, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;\n    return (ret);\n}', 'IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)', 'void *ASN1_item_dup(const ASN1_ITEM *it, void *x)\n{\n    unsigned char *b = NULL;\n    const unsigned char *p;\n    long i;\n    void *ret;\n    if (x == NULL)\n        return (NULL);\n    i = ASN1_item_i2d(x, &b, it);\n    if (b == NULL) {\n        ASN1err(ASN1_F_ASN1_ITEM_DUP, ERR_R_MALLOC_FAILURE);\n        return (NULL);\n    }\n    p = b;\n    ret = ASN1_item_d2i(NULL, &p, i, it);\n    OPENSSL_free(b);\n    return (ret);\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}', 'void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx)\n{\n    if (!ctx)\n        return;\n    X509_STORE_free(ctx->store);\n    sk_X509_pop_free(ctx->certs, X509_free);\n    ASN1_OBJECT_free(ctx->policy);\n    X509_ALGOR_free(ctx->md_alg);\n    OPENSSL_free(ctx->imprint);\n    BIO_free_all(ctx->data);\n    ASN1_INTEGER_free(ctx->nonce);\n    GENERAL_NAME_free(ctx->tsa_name);\n    TS_VERIFY_CTX_init(ctx);\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#ifdef REF_PRINT\n    REF_PRINT("X509_STORE", vfy);\n#endif\n    if (i > 0)\n        return;\n#ifdef REF_CHECK\n    if (i < 0) {\n        fprintf(stderr, "X509_STORE_free, bad reference count\\n");\n        abort();\n    }\n#endif\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}', 'DEFINE_STACK_OF(X509)', 'IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)', 'void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it)\n{\n    asn1_item_embed_free(&val, it, 0);\n}', 'void CRYPTO_free(void *str)\n{\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_free(str, 0);\n        free(str);\n        CRYPTO_mem_debug_free(str, 1);\n    } else {\n        free(str);\n    }\n#else\n    free(str);\n#endif\n}', 'void BIO_free_all(BIO *bio)\n{\n    BIO *b;\n    int ref;\n    while (bio != NULL) {\n        b = bio;\n        ref = b->references;\n        bio = bio->next_bio;\n        BIO_free(b);\n        if (ref > 1)\n            break;\n    }\n}', 'IMPLEMENT_ASN1_STRING_FUNCTIONS(ASN1_INTEGER)', 'void ASN1_STRING_free(ASN1_STRING *a)\n{\n    if (a == NULL)\n        return;\n    if (!(a->flags & ASN1_STRING_FLAG_NDEF))\n        OPENSSL_free(a->data);\n    if (!(a->flags & ASN1_STRING_FLAG_EMBED))\n        OPENSSL_free(a);\n}', 'IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAME)', 'void TS_VERIFY_CTX_init(TS_VERIFY_CTX *ctx)\n{\n    OPENSSL_assert(ctx != NULL);\n    memset(ctx, 0, sizeof(*ctx));\n}']