From 7cfd7f3fb1189fb88cdc2121e3cc5915abdd259c Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Wed, 24 May 2006 16:11:31 +0000
Subject: [PATCH] minor fix to make Curl_splayremove() return a NULL as
 "removed" in case nothing matched fine

---
 lib/splay.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/splay.c b/lib/splay.c
index 0ea078b6c0..6278089d1c 100644
--- a/lib/splay.c
+++ b/lib/splay.c
@@ -143,6 +143,8 @@ struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t,
 {
   struct Curl_tree *x;
 
+  *removed = NULL; /* default to no removed */
+
   if (t==NULL)
     return NULL;
 
@@ -174,10 +176,8 @@ struct Curl_tree *Curl_splayremove(int i, struct Curl_tree *t,
 
     return x;
   }
-  else {
-    *removed = NULL; /* no match */
+  else
     return t;                         /* It wasn't there */
-  }
 }
 
 /* Finds and deletes the best-fit node from the tree. Return a pointer to the
-- 
GitLab