crypto/x509/x509_att.c:253: error: MEMORY_LEAK
  memory dynamically allocated by call to `X509_ATTRIBUTE_set1_object()` at line 251, column 10 is not reachable after line 253, column 10.
Showing all 92 steps of the trace


crypto/x509/x509_att.c:235:1: start of procedure X509_ATTRIBUTE_create_by_OBJ()
233.   }
234.   
235. > X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr,
236.                                                const ASN1_OBJECT *obj,
237.                                                int atrtype, const void *data,

crypto/x509/x509_att.c:242:10: Taking false branch
240.       X509_ATTRIBUTE *ret;
241.   
242.       if ((attr == NULL) || (*attr == NULL)) {
                ^
243.           if ((ret = X509_ATTRIBUTE_new()) == NULL) {
244.               X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ,

crypto/x509/x509_att.c:242:28: Taking false branch
240.       X509_ATTRIBUTE *ret;
241.   
242.       if ((attr == NULL) || (*attr == NULL)) {
                                  ^
243.           if ((ret = X509_ATTRIBUTE_new()) == NULL) {
244.               X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_OBJ,

crypto/x509/x509_att.c:249:9: 
247.           }
248.       } else
249. >         ret = *attr;
250.   
251.       if (!X509_ATTRIBUTE_set1_object(ret, obj))

crypto/x509/x509_att.c:251:10: 
249.           ret = *attr;
250.   
251. >     if (!X509_ATTRIBUTE_set1_object(ret, obj))
252.           goto err;
253.       if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len))

crypto/x509/x509_att.c:285:1: start of procedure X509_ATTRIBUTE_set1_object()
  283.   }
  284.   
  285. > int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
  286.   {
  287.       if ((attr == NULL) || (obj == NULL))

crypto/x509/x509_att.c:287:10: Taking false branch
  285.   int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
  286.   {
  287.       if ((attr == NULL) || (obj == NULL))
                  ^
  288.           return (0);
  289.       ASN1_OBJECT_free(attr->object);

crypto/x509/x509_att.c:287:28: Taking false branch
  285.   int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj)
  286.   {
  287.       if ((attr == NULL) || (obj == NULL))
                                    ^
  288.           return (0);
  289.       ASN1_OBJECT_free(attr->object);

crypto/x509/x509_att.c:289:5: Skipping ASN1_OBJECT_free(): empty list of specs
  287.       if ((attr == NULL) || (obj == NULL))
  288.           return (0);
  289.       ASN1_OBJECT_free(attr->object);
             ^
  290.       attr->object = OBJ_dup(obj);
  291.       return (1);

crypto/x509/x509_att.c:290:5: 
  288.           return (0);
  289.       ASN1_OBJECT_free(attr->object);
  290. >     attr->object = OBJ_dup(obj);
  291.       return (1);
  292.   }

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/x509/x509_att.c:291:5: 
  289.       ASN1_OBJECT_free(attr->object);
  290.       attr->object = OBJ_dup(obj);
  291. >     return (1);
  292.   }
  293.   

crypto/x509/x509_att.c:292:1: return from a call to X509_ATTRIBUTE_set1_object
  290.       attr->object = OBJ_dup(obj);
  291.       return (1);
  292. > }
  293.   
  294.   int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype,

crypto/x509/x509_att.c:251:10: Taking false branch
249.           ret = *attr;
250.   
251.       if (!X509_ATTRIBUTE_set1_object(ret, obj))
                ^
252.           goto err;
253.       if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len))

crypto/x509/x509_att.c:253:10: Skipping X509_ATTRIBUTE_set1_data(): empty list of specs
251.       if (!X509_ATTRIBUTE_set1_object(ret, obj))
252.           goto err;
253.       if (!X509_ATTRIBUTE_set1_data(ret, atrtype, data, len))
                ^
254.           goto err;
255.   
