crypto/pkcs7/example.c:202: error: MEMORY_LEAK
  memory dynamically allocated by call to `ASN1_STRING_type_new()` at line 199, column 5 is not reachable after line 202, column 2.
Showing all 44 steps of the trace


crypto/pkcs7/example.c:190:1: start of procedure create_string()
188.   	}
189.   	
190. > X509_ATTRIBUTE *create_string(char *str)
191.   	{
192.   	ASN1_OCTET_STRING *os;

crypto/pkcs7/example.c:196:6: Taking true branch
194.   
195.   	/* To a an object of OID 1.2.3.4.5, which is an octet string */
196.   	if (signed_string_nid == -1)
            ^
197.   		signed_string_nid=
198.   			OBJ_create("1.2.3.4.5","OID_example","Our example OID");

crypto/pkcs7/example.c:197:3: 
195.   	/* To a an object of OID 1.2.3.4.5, which is an octet string */
196.   	if (signed_string_nid == -1)
197. > 		signed_string_nid=
198.   			OBJ_create("1.2.3.4.5","OID_example","Our example OID");
199.   	os=ASN1_OCTET_STRING_new();

crypto/objects/obj_dat.c:628:1: start of procedure OBJ_create()
  626.   	}
  627.   
  628. > int OBJ_create(char *oid, char *sn, char *ln)
  629.   	{
  630.   	int ok=0;

crypto/objects/obj_dat.c:630:2: 
  628.   int OBJ_create(char *oid, char *sn, char *ln)
  629.   	{
  630. > 	int ok=0;
  631.   	ASN1_OBJECT *op=NULL;
  632.   	unsigned char *buf;

crypto/objects/obj_dat.c:631:2: 
  629.   	{
  630.   	int ok=0;
  631. > 	ASN1_OBJECT *op=NULL;
  632.   	unsigned char *buf;
  633.   	int i;

crypto/objects/obj_dat.c:635:2: Skipping a2d_ASN1_OBJECT(): empty list of specs
  633.   	int i;
  634.   
  635.   	i=a2d_ASN1_OBJECT(NULL,0,oid,-1);
          ^
  636.   	if (i <= 0) return(0);
  637.   

crypto/objects/obj_dat.c:636:6: Taking false branch
  634.   
  635.   	i=a2d_ASN1_OBJECT(NULL,0,oid,-1);
  636.   	if (i <= 0) return(0);
              ^
  637.   
  638.   	if ((buf=(unsigned char *)Malloc(i)) == NULL)

crypto/objects/obj_dat.c:638:6: Taking false branch
  636.   	if (i <= 0) return(0);
  637.   
  638.   	if ((buf=(unsigned char *)Malloc(i)) == NULL)
              ^
  639.   		{
  640.   		OBJerr(OBJ_F_OBJ_CREATE,OBJ_R_MALLOC_FAILURE);

crypto/objects/obj_dat.c:643:2: Skipping a2d_ASN1_OBJECT(): empty list of specs
  641.   		return(0);
  642.   		}
  643.   	i=a2d_ASN1_OBJECT(buf,i,oid,-1);
          ^
  644.   	op=(ASN1_OBJECT *)ASN1_OBJECT_create(OBJ_new_nid(1),buf,i,sn,ln);
  645.   	if (op == NULL) 

crypto/objects/obj_dat.c:644:2: 
  642.   		}
  643.   	i=a2d_ASN1_OBJECT(buf,i,oid,-1);
  644. > 	op=(ASN1_OBJECT *)ASN1_OBJECT_create(OBJ_new_nid(1),buf,i,sn,ln);
  645.   	if (op == NULL) 
  646.   		goto err;

crypto/objects/obj_dat.c:205:1: start of procedure OBJ_new_nid()
    203.   	}
    204.   
    205. > int OBJ_new_nid(int num)
    206.   	{
    207.   	int i;

crypto/objects/obj_dat.c:209:2: 
    207.   	int i;
    208.   
    209. > 	i=new_nid;
    210.   	new_nid+=num;
    211.   	return(i);

crypto/objects/obj_dat.c:210:2: 
    208.   
    209.   	i=new_nid;
    210. > 	new_nid+=num;
    211.   	return(i);
    212.   	}

crypto/objects/obj_dat.c:211:2: 
    209.   	i=new_nid;
    210.   	new_nid+=num;
    211. > 	return(i);
    212.   	}
    213.   

crypto/objects/obj_dat.c:212:2: return from a call to OBJ_new_nid
    210.   	new_nid+=num;
    211.   	return(i);
    212.   	}
            ^
    213.   
    214.   int OBJ_add_object(ASN1_OBJECT *obj)

crypto/asn1/a_object.c:288:1: start of procedure ASN1_OBJECT_create()
    286.   	}
    287.   
    288. > ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
    289.   	     char *sn, char *ln)
    290.   	{

crypto/asn1/a_object.c:293:2: 
    291.   	ASN1_OBJECT o;
    292.   
    293. > 	o.sn=sn;
    294.   	o.ln=ln;
    295.   	o.data=data;

crypto/asn1/a_object.c:294:2: 
    292.   
    293.   	o.sn=sn;
    294. > 	o.ln=ln;
    295.   	o.data=data;
    296.   	o.nid=nid;

crypto/asn1/a_object.c:295:2: 
    293.   	o.sn=sn;
    294.   	o.ln=ln;
    295. > 	o.data=data;
    296.   	o.nid=nid;
    297.   	o.length=len;

crypto/asn1/a_object.c:296:2: 
    294.   	o.ln=ln;
    295.   	o.data=data;
    296. > 	o.nid=nid;
    297.   	o.length=len;
    298.   	o.flags=ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|

crypto/asn1/a_object.c:297:2: 
    295.   	o.data=data;
    296.   	o.nid=nid;
    297. > 	o.length=len;
    298.   	o.flags=ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|
    299.   		ASN1_OBJECT_FLAG_DYNAMIC_DATA;

crypto/asn1/a_object.c:298:2: 
    296.   	o.nid=nid;
    297.   	o.length=len;
    298. > 	o.flags=ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|
    299.   		ASN1_OBJECT_FLAG_DYNAMIC_DATA;
    300.   	return(OBJ_dup(&o));

crypto/asn1/a_object.c:300:2: Skipping OBJ_dup(): empty list of specs
    298.   	o.flags=ASN1_OBJECT_FLAG_DYNAMIC|ASN1_OBJECT_FLAG_DYNAMIC_STRINGS|
    299.   		ASN1_OBJECT_FLAG_DYNAMIC_DATA;
    300.   	return(OBJ_dup(&o));
            ^
    301.   	}
    302.   

crypto/asn1/a_object.c:301:2: return from a call to ASN1_OBJECT_create
    299.   		ASN1_OBJECT_FLAG_DYNAMIC_DATA;
    300.   	return(OBJ_dup(&o));
    301.   	}
            ^
    302.   
    303.   IMPLEMENT_STACK_OF(ASN1_OBJECT)

crypto/objects/obj_dat.c:645:6: Taking false branch
  643.   	i=a2d_ASN1_OBJECT(buf,i,oid,-1);
  644.   	op=(ASN1_OBJECT *)ASN1_OBJECT_create(OBJ_new_nid(1),buf,i,sn,ln);
  645.   	if (op == NULL) 
              ^
  646.   		goto err;
  647.   	ok=OBJ_add_object(op);

crypto/objects/obj_dat.c:647:2: Skipping OBJ_add_object(): empty list of specs
  645.   	if (op == NULL) 
  646.   		goto err;
  647.   	ok=OBJ_add_object(op);
          ^
  648.   err:
  649.   	ASN1_OBJECT_free(op);

crypto/objects/obj_dat.c:648:1: 
  646.   		goto err;
  647.   	ok=OBJ_add_object(op);
  648. > err:
  649.   	ASN1_OBJECT_free(op);
  650.   	Free((char *)buf);

crypto/objects/obj_dat.c:649:2: Skipping ASN1_OBJECT_free(): empty list of specs
  647.   	ok=OBJ_add_object(op);
  648.   err:
  649.   	ASN1_OBJECT_free(op);
          ^
  650.   	Free((char *)buf);
  651.   	return(ok);

crypto/objects/obj_dat.c:650:2: 
  648.   err:
  649.   	ASN1_OBJECT_free(op);
  650. > 	Free((char *)buf);
  651.   	return(ok);
  652.   	}

crypto/objects/obj_dat.c:651:2: 
  649.   	ASN1_OBJECT_free(op);
  650.   	Free((char *)buf);
  651. > 	return(ok);
  652.   	}
  653.   

crypto/objects/obj_dat.c:652:2: return from a call to OBJ_create
  650.   	Free((char *)buf);
  651.   	return(ok);
  652.   	}
          ^
  653.   

crypto/pkcs7/example.c:199:2: 
197.   		signed_string_nid=
198.   			OBJ_create("1.2.3.4.5","OID_example","Our example OID");
199. > 	os=ASN1_OCTET_STRING_new();
200.   	ASN1_OCTET_STRING_set(os,str,strlen(str));
201.   	/* When we add, we do not free */

crypto/asn1/asn1_lib.c:364:1: start of procedure ASN1_STRING_type_new()
  362.   
  363.   
  364. > ASN1_STRING *ASN1_STRING_type_new(int type)
  365.   	{
  366.   	ASN1_STRING *ret;

crypto/asn1/asn1_lib.c:368:2: 
  366.   	ASN1_STRING *ret;
  367.   
  368. > 	ret=(ASN1_STRING *)Malloc(sizeof(ASN1_STRING));
  369.   	if (ret == NULL)
  370.   		{

crypto/asn1/asn1_lib.c:369:6: Taking false branch
  367.   
  368.   	ret=(ASN1_STRING *)Malloc(sizeof(ASN1_STRING));
  369.   	if (ret == NULL)
              ^
  370.   		{
  371.   		ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW,ERR_R_MALLOC_FAILURE);

crypto/asn1/asn1_lib.c:374:2: 
  372.   		return(NULL);
  373.   		}
  374. > 	ret->length=0;
  375.   	ret->type=type;
  376.   	ret->data=NULL;

crypto/asn1/asn1_lib.c:375:2: 
  373.   		}
  374.   	ret->length=0;
  375. > 	ret->type=type;
  376.   	ret->data=NULL;
  377.   	ret->flags=0;

crypto/asn1/asn1_lib.c:376:2: 
  374.   	ret->length=0;
  375.   	ret->type=type;
  376. > 	ret->data=NULL;
  377.   	ret->flags=0;
  378.   	return(ret);

crypto/asn1/asn1_lib.c:377:2: 
  375.   	ret->type=type;
  376.   	ret->data=NULL;
  377. > 	ret->flags=0;
  378.   	return(ret);
  379.   	}

crypto/asn1/asn1_lib.c:378:2: 
  376.   	ret->data=NULL;
  377.   	ret->flags=0;
  378. > 	return(ret);
  379.   	}
  380.   

crypto/asn1/asn1_lib.c:379:2: return from a call to ASN1_STRING_type_new
  377.   	ret->flags=0;
  378.   	return(ret);
  379.   	}
          ^
  380.   
  381.   void ASN1_STRING_free(ASN1_STRING *a)

crypto/pkcs7/example.c:200:2: Skipping ASN1_STRING_set(): empty list of specs
198.   			OBJ_create("1.2.3.4.5","OID_example","Our example OID");
199.   	os=ASN1_OCTET_STRING_new();
200.   	ASN1_OCTET_STRING_set(os,str,strlen(str));
        ^
201.   	/* When we add, we do not free */
202.   	ret=X509_ATTRIBUTE_create(signed_string_nid,

crypto/pkcs7/example.c:202:2: Skipping X509_ATTRIBUTE_create(): empty list of specs
200.   	ASN1_OCTET_STRING_set(os,str,strlen(str));
201.   	/* When we add, we do not free */
202.   	ret=X509_ATTRIBUTE_create(signed_string_nid,
        ^
203.   		V_ASN1_OCTET_STRING,(char *)os);
204.   	return(ret);
