Module Name: src Committed By: christos Date: Wed Jan 20 20:47:41 UTC 2016
Modified Files: src/lib/libc/stdlib: tdelete.c Log Message: Don't return NULL when we are freeing the root node; return a free'd pointer instead. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/lib/libc/stdlib/tdelete.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/stdlib/tdelete.c diff -u src/lib/libc/stdlib/tdelete.c:1.7 src/lib/libc/stdlib/tdelete.c:1.8 --- src/lib/libc/stdlib/tdelete.c:1.7 Wed Jan 20 10:31:55 2016 +++ src/lib/libc/stdlib/tdelete.c Wed Jan 20 15:47:41 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: tdelete.c,v 1.7 2016/01/20 15:31:55 christos Exp $ */ +/* $NetBSD: tdelete.c,v 1.8 2016/01/20 20:47:41 christos Exp $ */ /* * Tree search generalized from Knuth (6.2.2) Algorithm T just like @@ -13,7 +13,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: tdelete.c,v 1.7 2016/01/20 15:31:55 christos Exp $"); +__RCSID("$NetBSD: tdelete.c,v 1.8 2016/01/20 20:47:41 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #include <assert.h> @@ -60,8 +60,6 @@ tdelete(const void *vkey, void **vrootp, q->rlink = (*rootp)->rlink; } } - if (p == *rootp) - p = NULL; free(*rootp); /* D4: Free node */ *rootp = q; /* link parent to new node */ return p;