crypto/x509v3/v3_conf.c:177: error: MEMORY_LEAK
  memory dynamically allocated by call to `malloc()` at line 169, column 17 is not reachable after line 177, column 6.
Showing all 34 steps of the trace


crypto/x509v3/v3_conf.c:160:1: start of procedure do_ext_i2d()
158.   }
159.   
160. > static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
161.   						 int crit, void *ext_struc)
162.   {

crypto/x509v3/v3_conf.c:168:2: Skipping __function_pointer__(): unresolved function pointer
166.   	X509_EXTENSION *ext;
167.   	/* Convert internal representation to DER */
168.   	ext_len = method->i2d(ext_struc, NULL);
        ^
169.   	if(!(ext_der = Malloc(ext_len))) goto merr;
170.   	p = ext_der;

crypto/x509v3/v3_conf.c:169:7: Taking false branch
167.   	/* Convert internal representation to DER */
168.   	ext_len = method->i2d(ext_struc, NULL);
169.   	if(!(ext_der = Malloc(ext_len))) goto merr;
             ^
170.   	p = ext_der;
171.   	method->i2d(ext_struc, &p);

crypto/x509v3/v3_conf.c:170:2: 
168.   	ext_len = method->i2d(ext_struc, NULL);
169.   	if(!(ext_der = Malloc(ext_len))) goto merr;
170. > 	p = ext_der;
171.   	method->i2d(ext_struc, &p);
172.   	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;

crypto/x509v3/v3_conf.c:171:2: Skipping __function_pointer__(): unresolved function pointer
169.   	if(!(ext_der = Malloc(ext_len))) goto merr;
170.   	p = ext_der;
171.   	method->i2d(ext_struc, &p);
        ^
172.   	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
173.   	ext_oct->data = ext_der;

crypto/x509v3/v3_conf.c:172:7: 
170.   	p = ext_der;
171.   	method->i2d(ext_struc, &p);
172. > 	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
173.   	ext_oct->data = ext_der;
174.   	ext_oct->length = ext_len;

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

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

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

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

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

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

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

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

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

crypto/x509v3/v3_conf.c:172:7: Taking false branch
170.   	p = ext_der;
171.   	method->i2d(ext_struc, &p);
172.   	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
             ^
173.   	ext_oct->data = ext_der;
174.   	ext_oct->length = ext_len;

crypto/x509v3/v3_conf.c:173:2: 
171.   	method->i2d(ext_struc, &p);
172.   	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
173. > 	ext_oct->data = ext_der;
174.   	ext_oct->length = ext_len;
175.   	

crypto/x509v3/v3_conf.c:174:2: 
172.   	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
173.   	ext_oct->data = ext_der;
174. > 	ext_oct->length = ext_len;
175.   	
176.   	ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);

crypto/x509v3/v3_conf.c:176:2: 
174.   	ext_oct->length = ext_len;
175.   	
176. > 	ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
177.   	if(!ext) goto merr;
178.   	ASN1_OCTET_STRING_free(ext_oct);

crypto/x509/x509_v3.c:176:1: start of procedure X509_EXTENSION_create_by_NID()
  174.   	}
  175.   
  176. > X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
  177.   	     int crit, ASN1_OCTET_STRING *data)
  178.   	{

crypto/x509/x509_v3.c:182:2: 
  180.   	X509_EXTENSION *ret;
  181.   
  182. > 	obj=OBJ_nid2obj(nid);
  183.   	if (obj == NULL)
  184.   		{

crypto/objects/obj_dat.c:258:1: start of procedure OBJ_nid2obj()
    256.   	}
    257.   
    258. > ASN1_OBJECT *OBJ_nid2obj(int n)
    259.   	{
    260.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:263:7: Taking true branch
    261.   	ASN1_OBJECT ob;
    262.   
    263.   	if ((n >= 0) && (n < NUM_NID))
                 ^
    264.   		{
    265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:263:19: Taking true branch
    261.   	ASN1_OBJECT ob;
    262.   
    263.   	if ((n >= 0) && (n < NUM_NID))
                             ^
    264.   		{
    265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:265:8: Taking false branch
    263.   	if ((n >= 0) && (n < NUM_NID))
    264.   		{
    265.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                  ^
    266.   			{
    267.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:270:3: 
    268.   			return(NULL);
    269.   			}
    270. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
    271.   		}
    272.   	else if (added == NULL)

crypto/objects/obj_dat.c:288:2: return from a call to OBJ_nid2obj
    286.   			}
    287.   		}
    288.   	}
            ^
    289.   
    290.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:183:6: Taking false branch
  181.   
  182.   	obj=OBJ_nid2obj(nid);
  183.   	if (obj == NULL)
              ^
  184.   		{
  185.   		X509err(X509_F_X509_EXTENSION_CREATE_BY_NID,X509_R_UNKNOWN_NID);

crypto/x509/x509_v3.c:188:2: Skipping X509_EXTENSION_create_by_OBJ(): empty list of specs
  186.   		return(NULL);
  187.   		}
  188.   	ret=X509_EXTENSION_create_by_OBJ(ex,obj,crit,data);
          ^
  189.   	if (ret == NULL) ASN1_OBJECT_free(obj);
  190.   	return(ret);

crypto/x509/x509_v3.c:189:6: Taking true branch
  187.   		}
  188.   	ret=X509_EXTENSION_create_by_OBJ(ex,obj,crit,data);
  189.   	if (ret == NULL) ASN1_OBJECT_free(obj);
              ^
  190.   	return(ret);
  191.   	}

crypto/x509/x509_v3.c:189:19: Skipping ASN1_OBJECT_free(): empty list of specs
  187.   		}
  188.   	ret=X509_EXTENSION_create_by_OBJ(ex,obj,crit,data);
  189.   	if (ret == NULL) ASN1_OBJECT_free(obj);
                           ^
  190.   	return(ret);
  191.   	}

crypto/x509/x509_v3.c:190:2: 
  188.   	ret=X509_EXTENSION_create_by_OBJ(ex,obj,crit,data);
  189.   	if (ret == NULL) ASN1_OBJECT_free(obj);
  190. > 	return(ret);
  191.   	}
  192.   

crypto/x509/x509_v3.c:191:2: return from a call to X509_EXTENSION_create_by_NID
  189.   	if (ret == NULL) ASN1_OBJECT_free(obj);
  190.   	return(ret);
  191.   	}
          ^
  192.   
  193.   X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,

crypto/x509v3/v3_conf.c:177:6: Taking true branch
175.   	
176.   	ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
177.   	if(!ext) goto merr;
            ^
178.   	ASN1_OCTET_STRING_free(ext_oct);
179.   

static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,
						 int crit, void *ext_struc)
{
	unsigned char *ext_der, *p;
	int ext_len;
	ASN1_OCTET_STRING *ext_oct;
	X509_EXTENSION *ext;
	ext_len = method->i2d(ext_struc, NULL);
	if(!(ext_der = Malloc(ext_len))) goto merr;
	p = ext_der;
	method->i2d(ext_struc, &p);
	if(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;
	ext_oct->data = ext_der;
	ext_oct->length = ext_len;
	ext = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);
	if(!ext) goto merr;
	ASN1_OCTET_STRING_free(ext_oct);
	return ext;
	merr:
	X509V3err(X509V3_F_DO_EXT_I2D,ERR_R_MALLOC_FAILURE);
	return NULL;
}
['static X509_EXTENSION *do_ext_i2d(X509V3_EXT_METHOD *method, int ext_nid,\n\t\t\t\t\t\t int crit, void *ext_struc)\n{\n\tunsigned char *ext_der, *p;\n\tint ext_len;\n\tASN1_OCTET_STRING *ext_oct;\n\tX509_EXTENSION *ext;\n\text_len = method->i2d(ext_struc, NULL);\n\tif(!(ext_der = Malloc(ext_len))) goto merr;\n\tp = ext_der;\n\tmethod->i2d(ext_struc, &p);\n\tif(!(ext_oct = ASN1_OCTET_STRING_new())) goto merr;\n\text_oct->data = ext_der;\n\text_oct->length = ext_len;\n\text = X509_EXTENSION_create_by_NID(NULL, ext_nid, crit, ext_oct);\n\tif(!ext) goto merr;\n\tASN1_OCTET_STRING_free(ext_oct);\n\treturn ext;\n\tmerr:\n\tX509V3err(X509V3_F_DO_EXT_I2D,ERR_R_MALLOC_FAILURE);\n\treturn NULL;\n}', 'ASN1_STRING *ASN1_STRING_type_new(int type)\n\t{\n\tASN1_STRING *ret;\n\tret=(ASN1_STRING *)Malloc(sizeof(ASN1_STRING));\n\tif (ret == NULL)\n\t\t{\n\t\tASN1err(ASN1_F_ASN1_STRING_TYPE_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->length=0;\n\tret->type=type;\n\tret->data=NULL;\n\tret->flags=0;\n\treturn(ret);\n\t}', 'X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,\n\t     int crit, ASN1_OCTET_STRING *data)\n\t{\n\tASN1_OBJECT *obj;\n\tX509_EXTENSION *ret;\n\tobj=OBJ_nid2obj(nid);\n\tif (obj == NULL)\n\t\t{\n\t\tX509err(X509_F_X509_EXTENSION_CREATE_BY_NID,X509_R_UNKNOWN_NID);\n\t\treturn(NULL);\n\t\t}\n\tret=X509_EXTENSION_create_by_OBJ(ex,obj,crit,data);\n\tif (ret == NULL) ASN1_OBJECT_free(obj);\n\treturn(ret);\n\t}', 'ASN1_OBJECT *OBJ_nid2obj(int n)\n\t{\n\tADDED_OBJ ad,*adp;\n\tASN1_OBJECT ob;\n\tif ((n >= 0) && (n < NUM_NID))\n\t\t{\n\t\tif ((n != NID_undef) && (nid_objs[n].nid == NID_undef))\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\treturn((ASN1_OBJECT *)&(nid_objs[n]));\n\t\t}\n\telse if (added == NULL)\n\t\treturn(NULL);\n\telse\n\t\t{\n\t\tad.type=ADDED_NID;\n\t\tad.obj= &ob;\n\t\tob.nid=n;\n\t\tadp=(ADDED_OBJ *)lh_retrieve(added,(char *)&ad);\n\t\tif (adp != NULL)\n\t\t\treturn(adp->obj);\n\t\telse\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\t}\n\t}']