Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/stdlib Don't return NULL when we are freeing the ro...



details:   https://anonhg.NetBSD.org/src/rev/2d0a86253772
branches:  trunk
changeset: 343051:2d0a86253772
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jan 20 20:47:41 2016 +0000

description:
Don't return NULL when we are freeing the root node; return a free'd pointer
instead.

diffstat:

 lib/libc/stdlib/tdelete.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r c8cc9ff7eebe -r 2d0a86253772 lib/libc/stdlib/tdelete.c
--- a/lib/libc/stdlib/tdelete.c Wed Jan 20 19:43:23 2016 +0000
+++ b/lib/libc/stdlib/tdelete.c Wed Jan 20 20:47:41 2016 +0000
@@ -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 @@
                        q->rlink = (*rootp)->rlink;
                }
        }
-       if (p == *rootp)
-               p = NULL;
        free(*rootp);                           /* D4: Free node */
        *rootp = q;                             /* link parent to new node */
        return p;



Home | Main Index | Thread Index | Old Index