crypto/asn1/p7_s_e.c:123: error: MEMORY_LEAK
  memory dynamically allocated to `return` by call to `malloc()` at line 120, column 2 is not reachable after line 123, column 2.
Showing all 37 steps of the trace


crypto/asn1/p7_s_e.c:115:1: start of procedure PKCS7_SIGN_ENVELOPE_new()
113.   	}
114.   
115. > PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void)
116.   	{
117.   	PKCS7_SIGN_ENVELOPE *ret=NULL;

crypto/asn1/p7_s_e.c:117:2: 
115.   PKCS7_SIGN_ENVELOPE *PKCS7_SIGN_ENVELOPE_new(void)
116.   	{
117. > 	PKCS7_SIGN_ENVELOPE *ret=NULL;
118.   	ASN1_CTX c;
119.   

crypto/asn1/p7_s_e.c:120:2: Taking false branch
118.   	ASN1_CTX c;
119.   
120.   	M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE);
        ^
121.   	M_ASN1_New(ret->version,ASN1_INTEGER_new);
122.   	M_ASN1_New(ret->recipientinfo,sk_new_null);

crypto/asn1/p7_s_e.c:121:2: 
119.   
120.   	M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE);
121. > 	M_ASN1_New(ret->version,ASN1_INTEGER_new);
122.   	M_ASN1_New(ret->recipientinfo,sk_new_null);
123.   	M_ASN1_New(ret->md_algs,sk_new_null);

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/asn1/p7_s_e.c:121:2: Taking false branch
119.   
120.   	M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE);
121.   	M_ASN1_New(ret->version,ASN1_INTEGER_new);
        ^
122.   	M_ASN1_New(ret->recipientinfo,sk_new_null);
123.   	M_ASN1_New(ret->md_algs,sk_new_null);

crypto/asn1/p7_s_e.c:122:2: 
120.   	M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE);
121.   	M_ASN1_New(ret->version,ASN1_INTEGER_new);
122. > 	M_ASN1_New(ret->recipientinfo,sk_new_null);
123.   	M_ASN1_New(ret->md_algs,sk_new_null);
124.   	M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);

crypto/stack/stack.c:117:1: start of procedure sk_new()
  115.   	}
  116.   
  117. > STACK *sk_new(int (*c)())
  118.   	{
  119.   	STACK *ret;

crypto/stack/stack.c:122:6: Taking false branch
  120.   	int i;
  121.   
  122.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
              ^
  123.   		goto err0;
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:124:6: Taking false branch
  122.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
  123.   		goto err0;
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
              ^
  125.   		goto err1;
  126.   	for (i=0; i<MIN_NODES; i++)

crypto/stack/stack.c:126:7: 
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
  125.   		goto err1;
  126. > 	for (i=0; i<MIN_NODES; i++)
  127.   		ret->data[i]=NULL;
  128.   	ret->comp=c;

crypto/stack/stack.c:126:12: Loop condition is true. Entering loop body
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
  125.   		goto err1;
  126.   	for (i=0; i<MIN_NODES; i++)
                    ^
  127.   		ret->data[i]=NULL;
  128.   	ret->comp=c;

crypto/stack/stack.c:127:3: 
  125.   		goto err1;
  126.   	for (i=0; i<MIN_NODES; i++)
  127. > 		ret->data[i]=NULL;
  128.   	ret->comp=c;
  129.   	ret->num_alloc=MIN_NODES;

crypto/stack/stack.c:126:25: 
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
  125.   		goto err1;
  126. > 	for (i=0; i<MIN_NODES; i++)
  127.   		ret->data[i]=NULL;
  128.   	ret->comp=c;

crypto/stack/stack.c:126:12: Loop condition is false. Leaving loop
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)
  125.   		goto err1;
  126.   	for (i=0; i<MIN_NODES; i++)
                    ^
  127.   		ret->data[i]=NULL;
  128.   	ret->comp=c;

crypto/stack/stack.c:128:2: 
  126.   	for (i=0; i<MIN_NODES; i++)
  127.   		ret->data[i]=NULL;
  128. > 	ret->comp=c;
  129.   	ret->num_alloc=MIN_NODES;
  130.   	ret->num=0;

crypto/stack/stack.c:129:2: 
  127.   		ret->data[i]=NULL;
  128.   	ret->comp=c;
  129. > 	ret->num_alloc=MIN_NODES;
  130.   	ret->num=0;
  131.   	ret->sorted=0;

crypto/stack/stack.c:130:2: 
  128.   	ret->comp=c;
  129.   	ret->num_alloc=MIN_NODES;
  130. > 	ret->num=0;
  131.   	ret->sorted=0;
  132.   	return(ret);

crypto/stack/stack.c:131:2: 
  129.   	ret->num_alloc=MIN_NODES;
  130.   	ret->num=0;
  131. > 	ret->sorted=0;
  132.   	return(ret);
  133.   err1:

crypto/stack/stack.c:132:2: 
  130.   	ret->num=0;
  131.   	ret->sorted=0;
  132. > 	return(ret);
  133.   err1:
  134.   	Free((char *)ret);

crypto/stack/stack.c:137:2: return from a call to sk_new
  135.   err0:
  136.   	return(NULL);
  137.   	}
          ^
  138.   
  139.   int sk_insert(STACK *st, char *data, int loc)

crypto/asn1/p7_s_e.c:122:2: Taking false branch
120.   	M_ASN1_New_Malloc(ret,PKCS7_SIGN_ENVELOPE);
121.   	M_ASN1_New(ret->version,ASN1_INTEGER_new);
122.   	M_ASN1_New(ret->recipientinfo,sk_new_null);
        ^
123.   	M_ASN1_New(ret->md_algs,sk_new_null);
124.   	M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);

crypto/asn1/p7_s_e.c:123:2: 
121.   	M_ASN1_New(ret->version,ASN1_INTEGER_new);
122.   	M_ASN1_New(ret->recipientinfo,sk_new_null);
123. > 	M_ASN1_New(ret->md_algs,sk_new_null);
124.   	M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);
125.   	ret->cert=NULL;

crypto/stack/stack.c:117:1: start of procedure sk_new()
  115.   	}
  116.   
  117. > STACK *sk_new(int (*c)())
  118.   	{
  119.   	STACK *ret;

crypto/stack/stack.c:122:6: Taking true branch
  120.   	int i;
  121.   
  122.   	if ((ret=(STACK *)Malloc(sizeof(STACK))) == NULL)
              ^
  123.   		goto err0;
  124.   	if ((ret->data=(char **)Malloc(sizeof(char *)*MIN_NODES)) == NULL)

crypto/stack/stack.c:135:1: 
  133.   err1:
  134.   	Free((char *)ret);
  135. > err0:
  136.   	return(NULL);
  137.   	}

crypto/stack/stack.c:136:2: 
  134.   	Free((char *)ret);
  135.   err0:
  136. > 	return(NULL);
  137.   	}
  138.   

crypto/stack/stack.c:137:2: return from a call to sk_new
  135.   err0:
  136.   	return(NULL);
  137.   	}
          ^
  138.   
  139.   int sk_insert(STACK *st, char *data, int loc)

crypto/asn1/p7_s_e.c:123:2: Taking true branch
121.   	M_ASN1_New(ret->version,ASN1_INTEGER_new);
122.   	M_ASN1_New(ret->recipientinfo,sk_new_null);
123.   	M_ASN1_New(ret->md_algs,sk_new_null);
        ^
124.   	M_ASN1_New(ret->enc_data,PKCS7_ENC_CONTENT_new);
125.   	ret->cert=NULL;
