Updated stack file; removed 'free' call
This commit is contained in:
		
							
								
								
									
										2
									
								
								stack.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								stack.c
									
									
									
									
									
								
							@@ -35,7 +35,7 @@ void stack_push(Stack* stack,void* element) {
 | 
			
		||||
 | 
			
		||||
void* stack_pop(Stack* stack) {
 | 
			
		||||
	assert( !(stack_isEmpty(stack)) );
 | 
			
		||||
	free(stack->data + stack->top_index);
 | 
			
		||||
//	free(stack->data + stack->top_index);
 | 
			
		||||
	stack->top_index--;
 | 
			
		||||
	void* to_return = *(stack->data + stack->top_index);
 | 
			
		||||
	*(stack->data + stack->top_index) = NULL;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user