aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hashtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/hashtab.c')
-rw-r--r--src/nvim/hashtab.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/nvim/hashtab.c b/src/nvim/hashtab.c
index 4918a0226f..7445a4cec1 100644
--- a/src/nvim/hashtab.c
+++ b/src/nvim/hashtab.c
@@ -347,18 +347,7 @@ static int hash_may_resize(hashtab_T *ht, int minitems)
}
} else {
// Allocate an array.
- newarray = (hashitem_T *)alloc((unsigned)(sizeof(hashitem_T) * newsize));
-
- if (newarray == NULL) {
- // Out of memory. When there are NULL items still return OK.
- // Otherwise set ht_error, because lookup may result in a hang if
- // we add another item.
- if (ht->ht_filled < ht->ht_mask) {
- return OK;
- }
- ht->ht_error = TRUE;
- return FAIL;
- }
+ newarray = xmalloc(sizeof(hashitem_T) * newsize);
oldarray = ht->ht_array;
}
memset(newarray, 0, (size_t)(sizeof(hashitem_T) * newsize));