crypto/x509v3/v3_alt.c:244: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_GENERAL_NAME_new()` at line 236, column 14 is not reachable after line 244, column 8.
Showing all 35 steps of the trace


crypto/x509v3/v3_alt.c:230:1: start of procedure v2i_subject_alt()
228.   }
229.   
230. > static STACK_OF(GENERAL_NAME) *v2i_subject_alt(X509V3_EXT_METHOD *method,
231.   						 X509V3_CTX *ctx, STACK *nval)
232.   {

crypto/x509v3/v3_alt.c:233:2: 
231.   						 X509V3_CTX *ctx, STACK *nval)
232.   {
233. > 	STACK_OF(GENERAL_NAME) *gens = NULL;
234.   	CONF_VALUE *cnf;
235.   	int i;

crypto/x509v3/v3_alt.c:236:7: 
234.   	CONF_VALUE *cnf;
235.   	int i;
236. > 	if(!(gens = sk_GENERAL_NAME_new(NULL))) {
237.   		X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
238.   		return NULL;

crypto/x509v3/v3_genn.c:240:1: start of procedure sk_GENERAL_NAME_new()
  238.   }
  239.   
  240. > IMPLEMENT_STACK_OF(GENERAL_NAME)
  241.   IMPLEMENT_ASN1_SET_OF(GENERAL_NAME)
  242.   

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/x509v3/v3_genn.c:240:1: return from a call to sk_GENERAL_NAME_new
  238.   }
  239.   
  240. > IMPLEMENT_STACK_OF(GENERAL_NAME)
  241.   IMPLEMENT_ASN1_SET_OF(GENERAL_NAME)
  242.   

crypto/x509v3/v3_alt.c:236:7: Taking false branch
234.   	CONF_VALUE *cnf;
235.   	int i;
236.   	if(!(gens = sk_GENERAL_NAME_new(NULL))) {
             ^
237.   		X509V3err(X509V3_F_V2I_GENERAL_NAMES,ERR_R_MALLOC_FAILURE);
238.   		return NULL;

crypto/x509v3/v3_alt.c:240:6: 
238.   		return NULL;
239.   	}
240. > 	for(i = 0; i < sk_num(nval); i++) {
241.   		cnf = (CONF_VALUE *)sk_value(nval, i);
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&

crypto/x509v3/v3_alt.c:240:13: Loop condition is true. Entering loop body
238.   		return NULL;
239.   	}
240.   	for(i = 0; i < sk_num(nval); i++) {
                   ^
241.   		cnf = (CONF_VALUE *)sk_value(nval, i);
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&

crypto/x509v3/v3_alt.c:241:3: 
239.   	}
240.   	for(i = 0; i < sk_num(nval); i++) {
241. > 		cnf = (CONF_VALUE *)sk_value(nval, i);
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&
243.   						!strcmp(cnf->value, "copy")) {

crypto/x509v3/v3_alt.c:242:7: 
240.   	for(i = 0; i < sk_num(nval); i++) {
241.   		cnf = (CONF_VALUE *)sk_value(nval, i);
242. > 		if(!name_cmp(cnf->name, "email") && cnf->value &&
243.   						!strcmp(cnf->value, "copy")) {
244.   			if(!copy_email(ctx, gens)) goto err;

crypto/x509v3/v3_utl.c:400:1: start of procedure name_cmp()
  398.    */
  399.   
  400. > int name_cmp(const char *name, const char *cmp)
  401.   {
  402.   	int len, ret;

crypto/x509v3/v3_utl.c:404:2: 
  402.   	int len, ret;
  403.   	char c;
  404. > 	len = strlen(cmp);
  405.   	if((ret = strncmp(name, cmp, len))) return ret;
  406.   	c = name[len];

crypto/x509v3/v3_utl.c:405:6: Taking false branch
  403.   	char c;
  404.   	len = strlen(cmp);
  405.   	if((ret = strncmp(name, cmp, len))) return ret;
              ^
  406.   	c = name[len];
  407.   	if(!c || (c=='.')) return 0;

crypto/x509v3/v3_utl.c:406:2: 
  404.   	len = strlen(cmp);
  405.   	if((ret = strncmp(name, cmp, len))) return ret;
  406. > 	c = name[len];
  407.   	if(!c || (c=='.')) return 0;
  408.   	return 1;

crypto/x509v3/v3_utl.c:407:6: Taking true branch
  405.   	if((ret = strncmp(name, cmp, len))) return ret;
  406.   	c = name[len];
  407.   	if(!c || (c=='.')) return 0;
              ^
  408.   	return 1;
  409.   }

crypto/x509v3/v3_utl.c:407:21: 
  405.   	if((ret = strncmp(name, cmp, len))) return ret;
  406.   	c = name[len];
  407. > 	if(!c || (c=='.')) return 0;
  408.   	return 1;
  409.   }

crypto/x509v3/v3_utl.c:409:1: return from a call to name_cmp
  407.   	if(!c || (c=='.')) return 0;
  408.   	return 1;
  409. > }

crypto/x509v3/v3_alt.c:242:7: Taking true branch
240.   	for(i = 0; i < sk_num(nval); i++) {
241.   		cnf = (CONF_VALUE *)sk_value(nval, i);
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&
             ^
243.   						!strcmp(cnf->value, "copy")) {
244.   			if(!copy_email(ctx, gens)) goto err;

crypto/x509v3/v3_alt.c:242:39: Taking true branch
240.   	for(i = 0; i < sk_num(nval); i++) {
241.   		cnf = (CONF_VALUE *)sk_value(nval, i);
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&
                                             ^
243.   						!strcmp(cnf->value, "copy")) {
244.   			if(!copy_email(ctx, gens)) goto err;

crypto/x509v3/v3_alt.c:243:8: Taking true branch
241.   		cnf = (CONF_VALUE *)sk_value(nval, i);
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&
243.   						!strcmp(cnf->value, "copy")) {
              ^
244.   			if(!copy_email(ctx, gens)) goto err;
245.   		} else {

crypto/x509v3/v3_alt.c:244:8: Skipping copy_email(): empty list of specs
242.   		if(!name_cmp(cnf->name, "email") && cnf->value &&
243.   						!strcmp(cnf->value, "copy")) {
244.   			if(!copy_email(ctx, gens)) goto err;
              ^
245.   		} else {
246.   			GENERAL_NAME *gen;
