[vlc-devel] [PATCH v2 2/2] compat: update tdelete from upstream NetBSD

Steve Lhomme robux4 at ycbcr.xyz
Fri Apr 2 07:12:32 UTC 2021


As found in http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdlib/tdelete.c?rev=1.8&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
Or https://github.com/NetBSD/src/blob/trunk/lib/libc/stdlib/tdelete.c

Our tfind, tsearch and twalk are already similar to upstream. For some reason,
tdestroy is not there as a single file anymore.

Fixes some leaks solved on 2016-01-20.
---
 compat/tfind.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/compat/tfind.c b/compat/tfind.c
index 03382f2aea5..a6110ecf00b 100644
--- a/compat/tfind.c
+++ b/compat/tfind.c
@@ -67,8 +67,7 @@ tdelete(const void* vkey, void** vrootp, int (*compar)(const void*, const void*)
 			q->rlink = (*rootp)->rlink;
 		}
 	}
-	if (p != *rootp)
-		free(*rootp);			/* D4: Free node */
+	free(*rootp);				/* D4: Free node */
 	*rootp = q;				/* link parent to new node */
 	return p;
 }
-- 
2.29.2



More information about the vlc-devel mailing list