1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

tdelete(3): don't delete the node we are about to return.

CID:		272528
Obtained from:	NetBSD (CVS rev. 1.4)
MFC after:	2 weeks
This commit is contained in:
Pedro F. Giffuni 2015-02-05 23:02:43 +00:00
parent 5262b957d4
commit b20592de1b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278301

View File

@ -65,7 +65,8 @@ tdelete(const void * __restrict vkey, void ** __restrict vrootp,
q->rlink = (*rootp)->rlink;
}
}
free(*rootp); /* D4: Free node */
if (p != *rootp)
free(*rootp); /* D4: Free node */
*rootp = q; /* link parent to new node */
return p;
}