From 4d8bfe2ec9fd4159c9422fa6e5664a2624b40a96 Mon Sep 17 00:00:00 2001 From: Shezza221b <41204318+Shezza221b@users.noreply.github.com> Date: Thu, 1 Oct 2020 05:19:29 +0530 Subject: [PATCH] Update data_structures/linked_list/stack_using_linked_lists.c Co-authored-by: David Leal --- data_structures/linked_list/stack_using_linked_lists.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_structures/linked_list/stack_using_linked_lists.c b/data_structures/linked_list/stack_using_linked_lists.c index 6204e739b8..ec1e417530 100644 --- a/data_structures/linked_list/stack_using_linked_lists.c +++ b/data_structures/linked_list/stack_using_linked_lists.c @@ -72,8 +72,8 @@ void pop(struct node *p) { item = top->info; temp = top; - top = top->link; - free(temp); + top = top->link; + free(temp); printf("Element popped is%d\n", item); } }