crypto/pkcs12/p12_sbag.c:149: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `malloc()` at line 146, column 2 is not reachable after line 149, column 2.
Showing all 14 steps of the trace


crypto/pkcs12/p12_sbag.c:142:1: start of procedure PKCS12_SAFEBAG_new()
140.   }
141.   
142. > PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void)
143.   {
144.   	PKCS12_SAFEBAG *ret=NULL;

crypto/pkcs12/p12_sbag.c:144:2: 
142.   PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void)
143.   {
144. > 	PKCS12_SAFEBAG *ret=NULL;
145.   	ASN1_CTX c;
146.   	M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);

crypto/pkcs12/p12_sbag.c:146:2: Taking false branch
144.   	PKCS12_SAFEBAG *ret=NULL;
145.   	ASN1_CTX c;
146.   	M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);
        ^
147.   	ret->type=NULL;
148.   	ret->value.other=NULL;

crypto/pkcs12/p12_sbag.c:147:2: 
145.   	ASN1_CTX c;
146.   	M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);
147. > 	ret->type=NULL;
148.   	ret->value.other=NULL;
149.   	M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);

crypto/pkcs12/p12_sbag.c:148:2: 
146.   	M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);
147.   	ret->type=NULL;
148. > 	ret->value.other=NULL;
149.   	M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);
150.   	ret->rest=NULL;

crypto/pkcs12/p12_sbag.c:149:2: 
147.   	ret->type=NULL;
148.   	ret->value.other=NULL;
149. > 	M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);
150.   	ret->rest=NULL;
151.   	return (ret);

crypto/x509/x509_vfy.c:638:1: start of procedure sk_X509_ATTRIBUTE_new_null()
  636.   IMPLEMENT_STACK_OF(X509_NAME)
  637.   
  638. > IMPLEMENT_STACK_OF(X509_ATTRIBUTE)
  639.   IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE)

crypto/stack/stack.c:112:1: start of procedure sk_new()
    110.   	}
    111.   
    112. > STACK *sk_new(int (*c)())
    113.   	{
    114.   	STACK *ret;

crypto/stack/stack.c:117:6: Taking true branch
    115.   	int i;
    116.   
    117.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
                ^
    118.   		goto err0;
    119.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:130:1: 
    128.   err1:
    129.   	Free((char *)ret);
    130. > err0:
    131.   	return(NULL);
    132.   	}

crypto/stack/stack.c:131:2: 
    129.   	Free((char *)ret);
    130.   err0:
    131. > 	return(NULL);
    132.   	}
    133.   

crypto/stack/stack.c:132:2: return from a call to sk_new
    130.   err0:
    131.   	return(NULL);
    132.   	}
            ^
    133.   
    134.   int sk_insert(STACK *st, char *data, int loc)

crypto/x509/x509_vfy.c:638:1: return from a call to sk_X509_ATTRIBUTE_new_null
  636.   IMPLEMENT_STACK_OF(X509_NAME)
  637.   
  638. > IMPLEMENT_STACK_OF(X509_ATTRIBUTE)
  639.   IMPLEMENT_ASN1_SET_OF(X509_ATTRIBUTE)

crypto/pkcs12/p12_sbag.c:149:2: Taking true branch
147.   	ret->type=NULL;
148.   	ret->value.other=NULL;
149.   	M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);
        ^
150.   	ret->rest=NULL;
151.   	return (ret);

PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void)
{
	PKCS12_SAFEBAG *ret=NULL;
	ASN1_CTX c;
	M_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);
	ret->type=NULL;
	ret->value.other=NULL;
	M_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);
	ret->rest=NULL;
	return (ret);
	M_ASN1_New_Error(ASN1_F_PKCS12_SAFEBAG_NEW);
}
['PKCS12_SAFEBAG *PKCS12_SAFEBAG_new(void)\n{\n\tPKCS12_SAFEBAG *ret=NULL;\n\tASN1_CTX c;\n\tM_ASN1_New_Malloc(ret, PKCS12_SAFEBAG);\n\tret->type=NULL;\n\tret->value.other=NULL;\n\tM_ASN1_New(ret->attrib, sk_X509_ATTRIBUTE_new_null);\n\tret->rest=NULL;\n\treturn (ret);\n\tM_ASN1_New_Error(ASN1_F_PKCS12_SAFEBAG_NEW);\n}', 'IMPLEMENT_STACK_OF(X509_ATTRIBUTE)', 'STACK *sk_new(int (*c)())\n\t{\n\tSTACK *ret;\n\tint i;\n\tif ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)\n\t\tgoto err0;\n\tif ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)\n\t\tgoto err1;\n\tfor (i=0; i<MIN_NODES; i++)\n\t\tret->data[i]=NULL;\n\tret->comp=c;\n\tret->num_alloc=MIN_NODES;\n\tret->num=0;\n\tret->sorted=0;\n\treturn(ret);\nerr1:\n\tFree((char *)ret);\nerr0:\n\treturn(NULL);\n\t}']