Fix guththila stack issues
guththila_stack_push allocates memory is chunks of stack->max or
stack->max * 2, however guththila_stack_del_top tries to free individual data
elements, leading to memory errors. Changed del_top function to remove
value from stack but not attempt to free the memory (which will be freed
when stack_un_init or stack_free is called).
Also, in guththila_stack_un_init, set stack_data = NULL after freeing, to
avoid possible double free if stack_free is inadvertently called after
stack_un_init.
1 file changed