mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
fix tsearch to avoid crash on oom
malloc failure was not properly propagated in the insertion method which led to null pointer dereference.
This commit is contained in:
parent
e4f9d81168
commit
bc9744763a
1 changed files with 1 additions and 1 deletions
|
@ -89,8 +89,8 @@ static struct node *insert(struct node **n, const void *k,
|
|||
r->key = k;
|
||||
r->left = r->right = 0;
|
||||
r->height = 1;
|
||||
*new = 1;
|
||||
}
|
||||
*new = 1;
|
||||
return r;
|
||||
}
|
||||
c = cmp(k, r->key);
|
||||
|
|
Loading…
Add table
Reference in a new issue