diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-05-22 12:50:59 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-05-22 13:00:51 -0400 |
commit | e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72 (patch) | |
tree | 6ff1b06b5d5fd6d3260f3a778c33cfaf03f0c295 /src/nvim/hashtab.c | |
parent | 0aa8b5828cc0674894681841f40c3c05bfd2f07b (diff) | |
parent | e303a11ebfc352860cce73184ece692ab4d0f01c (diff) | |
download | rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.gz rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.tar.bz2 rneovim-e2e47803bdfd5fb40e3dbc9cdf798bb27d306c72.zip |
Merge #708 'Remove NULL/non-NULL tests after vim_str(n)save'
- replace alloc with xmalloc
Diffstat (limited to 'src/nvim/hashtab.c')
-rw-r--r-- | src/nvim/hashtab.c | 13 |
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)); |