summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/tsearch.3
diff options
context:
space:
mode:
authormoritz <>2006-04-04 11:21:50 +0000
committermoritz <>2006-04-04 11:21:50 +0000
commit98d91b101f726e2dc971f807de9ed123cb2b80e4 (patch)
tree5323c35c56bef0dde8489a327c1c09f6dd135365 /src/lib/libc/stdlib/tsearch.3
parentfd6d62e96b81f055cd4c12eab824a3d30d264979 (diff)
downloadopenbsd-98d91b101f726e2dc971f807de9ed123cb2b80e4.tar.gz
openbsd-98d91b101f726e2dc971f807de9ed123cb2b80e4.tar.bz2
openbsd-98d91b101f726e2dc971f807de9ed123cb2b80e4.zip
When tdelete() is used to delete the root node, don't return a
pointer to the freed root node, but return a pointer to the new root node. POSIX does not define, what should be returned in that case. Fixes Coverity CID 2528. ok millert@ otto@
Diffstat (limited to 'src/lib/libc/stdlib/tsearch.3')
-rw-r--r--src/lib/libc/stdlib/tsearch.34
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/tsearch.3 b/src/lib/libc/stdlib/tsearch.3
index 589f0574a8..ebc521ba17 100644
--- a/src/lib/libc/stdlib/tsearch.3
+++ b/src/lib/libc/stdlib/tsearch.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: tsearch.3,v 1.13 2006/01/30 19:50:41 jmc Exp $ 1.\" $OpenBSD: tsearch.3,v 1.14 2006/04/04 11:21:50 moritz Exp $
2.\" 2.\"
3.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> 3.\" Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
4.\" 4.\"
@@ -74,7 +74,7 @@ and
74.Fn tsearch . 74.Fn tsearch .
75If the node to be deleted is the root of the binary search tree, 75If the node to be deleted is the root of the binary search tree,
76.Fa rootp 76.Fa rootp
77will be adjusted. 77will be adjusted and a pointer to the new root will be returned.
78.Pp 78.Pp
79.Fn twalk 79.Fn twalk
80walks the binary search tree rooted in 80walks the binary search tree rooted in