From 7a0a8aa443816501a2418ecd95e84384b40e48b3 Mon Sep 17 00:00:00 2001 From: Irtaza Hyder Date: Sat, 24 Aug 2024 14:24:18 +0500 Subject: [PATCH] Memory Leak fixed --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 42382ee..a67b650 100644 --- a/README.md +++ b/README.md @@ -424,15 +424,14 @@ Node* __delete(Node *node,int data,bool &ok) if(red(node)) /// the node is red => just delete it { - free(node); ok = true; } else if(red(temp)) /// only child is red => replace with that red child and recolor black . so , black balance restored { temp->color = BLACK; - free(node); ok = true; } + free(node); return temp; }