ssl/ssl_cert.c:230: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_new()` at line 224, column 6 is not reachable after line 230, column 4.
Showing all 36 steps of the trace


ssl/ssl_cert.c:218:1: start of procedure SSL_dup_CA_list()
216.   	}
217.   
218. > STACK *SSL_dup_CA_list(STACK *sk)
219.   	{
220.   	int i;

ssl/ssl_cert.c:224:2: 
222.   	X509_NAME *name;
223.   
224. > 	ret=sk_new_null();
225.   	for (i=0; i<sk_num(sk); i++)
226.   		{

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)

ssl/ssl_cert.c:225:7: 
223.   
224.   	ret=sk_new_null();
225. > 	for (i=0; i<sk_num(sk); i++)
226.   		{
227.   		name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));

ssl/ssl_cert.c:225:12: Loop condition is true. Entering loop body
223.   
224.   	ret=sk_new_null();
225.   	for (i=0; i<sk_num(sk); i++)
                  ^
226.   		{
227.   		name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));

ssl/ssl_cert.c:227:3: 
225.   	for (i=0; i<sk_num(sk); i++)
226.   		{
227. > 		name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
228.   		if ((name == NULL) || !sk_push(ret,(char *)name))
229.   			{

crypto/x509/x_all.c:353:1: start of procedure X509_NAME_dup()
  351.   	}
  352.   
  353. > X509_NAME *X509_NAME_dup(X509_NAME *xn)
  354.   	{
  355.   	return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,

crypto/x509/x_all.c:355:2: 
  353.   X509_NAME *X509_NAME_dup(X509_NAME *xn)
  354.   	{
  355. > 	return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,
  356.   		(char *(*)())d2i_X509_NAME,(char *)xn));
  357.   	}

crypto/asn1/a_dup.c:65:1: start of procedure ASN1_dup()
    63.   #define READ_CHUNK   2048
    64.   
    65. > char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)
    66.   	{
    67.   	unsigned char *b,*p;

crypto/asn1/a_dup.c:71:6: Taking false branch
    69.   	char *ret;
    70.   
    71.   	if (x == NULL) return(NULL);
               ^
    72.   
    73.   	i=(long)i2d(x,NULL);

crypto/asn1/a_dup.c:73:2: Skipping __function_pointer__(): unresolved function pointer
    71.   	if (x == NULL) return(NULL);
    72.   
    73.   	i=(long)i2d(x,NULL);
           ^
    74.   	b=(unsigned char *)Malloc((unsigned int)i+10);
    75.   	if (b == NULL)

crypto/asn1/a_dup.c:74:2: 
    72.   
    73.   	i=(long)i2d(x,NULL);
    74. > 	b=(unsigned char *)Malloc((unsigned int)i+10);
    75.   	if (b == NULL)
    76.   		{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }

crypto/asn1/a_dup.c:75:6: Taking false branch
    73.   	i=(long)i2d(x,NULL);
    74.   	b=(unsigned char *)Malloc((unsigned int)i+10);
    75.   	if (b == NULL)
               ^
    76.   		{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
    77.   	p= b;

crypto/asn1/a_dup.c:77:2: 
    75.   	if (b == NULL)
    76.   		{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
    77. > 	p= b;
    78.   	i=i2d(x,&p);
    79.   	p= b;

crypto/asn1/a_dup.c:78:2: Skipping __function_pointer__(): unresolved function pointer
    76.   		{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }
    77.   	p= b;
    78.   	i=i2d(x,&p);
           ^
    79.   	p= b;
    80.   	ret=d2i(NULL,&p,i);

crypto/asn1/a_dup.c:79:2: 
    77.   	p= b;
    78.   	i=i2d(x,&p);
    79. > 	p= b;
    80.   	ret=d2i(NULL,&p,i);
    81.   	Free((char *)b);

crypto/asn1/a_dup.c:80:2: Skipping __function_pointer__(): unresolved function pointer
    78.   	i=i2d(x,&p);
    79.   	p= b;
    80.   	ret=d2i(NULL,&p,i);
           ^
    81.   	Free((char *)b);
    82.   	return(ret);

crypto/asn1/a_dup.c:81:2: 
    79.   	p= b;
    80.   	ret=d2i(NULL,&p,i);
    81. > 	Free((char *)b);
    82.   	return(ret);
    83.   	}

crypto/asn1/a_dup.c:82:2: 
    80.   	ret=d2i(NULL,&p,i);
    81.   	Free((char *)b);
    82. > 	return(ret);
    83.   	}

crypto/asn1/a_dup.c:83:2: return from a call to ASN1_dup
    81.   	Free((char *)b);
    82.   	return(ret);
    83.   	}
           ^

crypto/x509/x_all.c:357:2: return from a call to X509_NAME_dup
  355.   	return((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,
  356.   		(char *(*)())d2i_X509_NAME,(char *)xn));
  357.   	}
          ^
  358.   
  359.   X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne)

ssl/ssl_cert.c:228:8: Taking true branch
226.   		{
227.   		name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
228.   		if ((name == NULL) || !sk_push(ret,(char *)name))
              ^
229.   			{
230.   			sk_pop_free(ret,X509_NAME_free);

ssl/ssl_cert.c:230:4: Skipping sk_pop_free(): empty list of specs
228.   		if ((name == NULL) || !sk_push(ret,(char *)name))
229.   			{
230.   			sk_pop_free(ret,X509_NAME_free);
          ^
231.   			return(NULL);
232.   			}

STACK *SSL_dup_CA_list(STACK *sk)
	{
	int i;
	STACK *ret;
	X509_NAME *name;
	ret=sk_new_null();
	for (i=0; i<sk_num(sk); i++)
		{
		name=X509_NAME_dup((X509_NAME *)sk_value(sk,i));
		if ((name == NULL) || !sk_push(ret,(char *)name))
			{
			sk_pop_free(ret,X509_NAME_free);
			return(NULL);
			}
		}
	return(ret);
	}
['STACK *SSL_dup_CA_list(STACK *sk)\n\t{\n\tint i;\n\tSTACK *ret;\n\tX509_NAME *name;\n\tret=sk_new_null();\n\tfor (i=0; i<sk_num(sk); i++)\n\t\t{\n\t\tname=X509_NAME_dup((X509_NAME *)sk_value(sk,i));\n\t\tif ((name == NULL) || !sk_push(ret,(char *)name))\n\t\t\t{\n\t\t\tsk_pop_free(ret,X509_NAME_free);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\t}\n\treturn(ret);\n\t}', '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}', 'X509_NAME *X509_NAME_dup(X509_NAME *xn)\n\t{\n\treturn((X509_NAME *)ASN1_dup((int (*)())i2d_X509_NAME,\n\t\t(char *(*)())d2i_X509_NAME,(char *)xn));\n\t}', 'char *ASN1_dup(int (*i2d)(), char *(*d2i)(), char *x)\n\t{\n\tunsigned char *b,*p;\n\tlong i;\n\tchar *ret;\n\tif (x == NULL) return(NULL);\n\ti=(long)i2d(x,NULL);\n\tb=(unsigned char *)Malloc((unsigned int)i+10);\n\tif (b == NULL)\n\t\t{ ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); }\n\tp= b;\n\ti=i2d(x,&p);\n\tp= b;\n\tret=d2i(NULL,&p,i);\n\tFree((char *)b);\n\treturn(ret);\n\t}']