crypto/x509v3/v3_sxnet.c:334: error: MEMORY_LEAK
  memory dynamically allocated by call to `ASN1_STRING_type_new()` at line 329, column 15 is not reachable after line 334, column 2.
Showing all 23 steps of the trace


crypto/x509v3/v3_sxnet.c:325:1: start of procedure SXNET_get_id_ulong()
323.   }
324.   
325. > ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone)
326.   {
327.   	ASN1_INTEGER *izone = NULL;

crypto/x509v3/v3_sxnet.c:327:2: 
325.   ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone)
326.   {
327. > 	ASN1_INTEGER *izone = NULL;
328.   	ASN1_OCTET_STRING *oct;
329.   	if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {

crypto/x509v3/v3_sxnet.c:329:7: 
327.   	ASN1_INTEGER *izone = NULL;
328.   	ASN1_OCTET_STRING *oct;
329. > 	if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
330.   		X509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);
331.   		ASN1_INTEGER_free(izone);

crypto/asn1/asn1_lib.c:368:1: start of procedure ASN1_STRING_type_new()
  366.   
  367.   
  368. > ASN1_STRING *ASN1_STRING_type_new(int type)
  369.   	{
  370.   	ASN1_STRING *ret;

crypto/asn1/asn1_lib.c:372:2: 
  370.   	ASN1_STRING *ret;
  371.   
  372. > 	ret=(ASN1_STRING *)Malloc(sizeof(ASN1_STRING));
  373.   	if (ret == NULL)
  374.   		{

crypto/asn1/asn1_lib.c:373:6: Taking false branch
  371.   
  372.   	ret=(ASN1_STRING *)Malloc(sizeof(ASN1_STRING));
  373.   	if (ret == NULL)
              ^
  374.   		{
  375.   		ASN1err(ASN1_F_ASN1_STRING_TYPE_NEW,ERR_R_MALLOC_FAILURE);

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

crypto/asn1/asn1_lib.c:379:2: 
  377.   		}
  378.   	ret->length=0;
  379. > 	ret->type=type;
  380.   	ret->data=NULL;
  381.   	ret->flags=0;

crypto/asn1/asn1_lib.c:380:2: 
  378.   	ret->length=0;
  379.   	ret->type=type;
  380. > 	ret->data=NULL;
  381.   	ret->flags=0;
  382.   	return(ret);

crypto/asn1/asn1_lib.c:381:2: 
  379.   	ret->type=type;
  380.   	ret->data=NULL;
  381. > 	ret->flags=0;
  382.   	return(ret);
  383.   	}

crypto/asn1/asn1_lib.c:382:2: 
  380.   	ret->data=NULL;
  381.   	ret->flags=0;
  382. > 	return(ret);
  383.   	}
  384.   

crypto/asn1/asn1_lib.c:383:2: return from a call to ASN1_STRING_type_new
  381.   	ret->flags=0;
  382.   	return(ret);
  383.   	}
          ^
  384.   
  385.   void ASN1_STRING_free(ASN1_STRING *a)

crypto/x509v3/v3_sxnet.c:329:7: Taking false branch
327.   	ASN1_INTEGER *izone = NULL;
328.   	ASN1_OCTET_STRING *oct;
329.   	if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
             ^
330.   		X509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);
331.   		ASN1_INTEGER_free(izone);

crypto/x509v3/v3_sxnet.c:329:39: Taking false branch
327.   	ASN1_INTEGER *izone = NULL;
328.   	ASN1_OCTET_STRING *oct;
329.   	if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
                                             ^
330.   		X509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);
331.   		ASN1_INTEGER_free(izone);

crypto/x509v3/v3_sxnet.c:334:2: 
332.   		return NULL;
333.   	}
334. > 	oct = SXNET_get_id_INTEGER(sx, izone);
335.   	ASN1_INTEGER_free(oct);
336.   	return oct;

crypto/x509v3/v3_sxnet.c:339:1: start of procedure SXNET_get_id_INTEGER()
  337.   }
  338.   
  339. > ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)
  340.   {
  341.   	SXNETID *id;

crypto/x509v3/v3_sxnet.c:343:6: 
  341.   	SXNETID *id;
  342.   	int i;
  343. > 	for(i = 0; i < sk_SXNETID_num(sx->ids); i++) {
  344.   		id = sk_SXNETID_value(sx->ids, i);
  345.   		if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;

crypto/x509v3/v3_sxnet.c:343:13: 
  341.   	SXNETID *id;
  342.   	int i;
  343. > 	for(i = 0; i < sk_SXNETID_num(sx->ids); i++) {
  344.   		id = sk_SXNETID_value(sx->ids, i);
  345.   		if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;

crypto/x509v3/v3_sxnet.c:350:1: start of procedure sk_SXNETID_num()
    348.   }
    349.   
    350. > IMPLEMENT_STACK_OF(SXNETID)
    351.   IMPLEMENT_ASN1_SET_OF(SXNETID)

crypto/x509v3/v3_sxnet.c:350:1: return from a call to sk_SXNETID_num
    348.   }
    349.   
    350. > IMPLEMENT_STACK_OF(SXNETID)
    351.   IMPLEMENT_ASN1_SET_OF(SXNETID)

crypto/x509v3/v3_sxnet.c:343:13: Loop condition is false. Leaving loop
  341.   	SXNETID *id;
  342.   	int i;
  343.   	for(i = 0; i < sk_SXNETID_num(sx->ids); i++) {
                     ^
  344.   		id = sk_SXNETID_value(sx->ids, i);
  345.   		if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;

crypto/x509v3/v3_sxnet.c:347:2: 
  345.   		if(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;
  346.   	}
  347. > 	return NULL;
  348.   }
  349.   

crypto/x509v3/v3_sxnet.c:348:1: return from a call to SXNET_get_id_INTEGER
  346.   	}
  347.   	return NULL;
  348. > }
  349.   
  350.   IMPLEMENT_STACK_OF(SXNETID)

ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone)
{
	ASN1_INTEGER *izone = NULL;
	ASN1_OCTET_STRING *oct;
	if(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
		X509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);
		ASN1_INTEGER_free(izone);
		return NULL;
	}
	oct = SXNET_get_id_INTEGER(sx, izone);
	ASN1_INTEGER_free(oct);
	return oct;
}
['ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone)\n{\n\tASN1_INTEGER *izone = NULL;\n\tASN1_OCTET_STRING *oct;\n\tif(!(izone = ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {\n\t\tX509V3err(X509V3_F_SXNET_GET_ID_ULONG,ERR_R_MALLOC_FAILURE);\n\t\tASN1_INTEGER_free(izone);\n\t\treturn NULL;\n\t}\n\toct = SXNET_get_id_INTEGER(sx, izone);\n\tASN1_INTEGER_free(oct);\n\treturn oct;\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}', 'ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)\n{\n\tSXNETID *id;\n\tint i;\n\tfor(i = 0; i < sk_SXNETID_num(sx->ids); i++) {\n\t\tid = sk_SXNETID_value(sx->ids, i);\n\t\tif(!ASN1_INTEGER_cmp(id->zone, zone)) return id->user;\n\t}\n\treturn NULL;\n}', 'IMPLEMENT_STACK_OF(SXNETID)']