crypto/stack/stack.c:104: error: MEMORY_LEAK
  memory dynamically allocated by call to `sk_new()` at line 101, column 11 is not reachable after line 104, column 6.
Showing all 19 steps of the trace


crypto/stack/stack.c:96:1: start of procedure sk_dup()
94.   	}
95.   
96. > STACK *sk_dup(STACK *sk)
97.   	{
98.   	STACK *ret;

crypto/stack/stack.c:101:6: 
99.   	char **s;
100.   
101. > 	if ((ret=sk_new(sk->comp)) == NULL) goto err;
102.   	s=(char **)Realloc((char *)ret->data,
103.   		(unsigned int)sizeof(char *)*sk->num_alloc);

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/stack/stack.c:101:6: Taking false branch
99.   	char **s;
100.   
101.   	if ((ret=sk_new(sk->comp)) == NULL) goto err;
            ^
102.   	s=(char **)Realloc((char *)ret->data,
103.   		(unsigned int)sizeof(char *)*sk->num_alloc);

crypto/stack/stack.c:102:2: 
100.   
101.   	if ((ret=sk_new(sk->comp)) == NULL) goto err;
102. > 	s=(char **)Realloc((char *)ret->data,
103.   		(unsigned int)sizeof(char *)*sk->num_alloc);
104.   	if (s == NULL) goto err;

crypto/stack/stack.c:104:6: Taking true branch
102.   	s=(char **)Realloc((char *)ret->data,
103.   		(unsigned int)sizeof(char *)*sk->num_alloc);
104.   	if (s == NULL) goto err;
            ^
105.   	ret->data=s;
106.   
