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:
parent
5262b957d4
commit
b20592de1b
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user