diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-12-26 13:08:06 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-12-26 13:08:06 +0000 |
commit | 81b7ecc5cb78cad901a9a85e46ecba109cc6ee7d (patch) | |
tree | bb1c6ab4600ec9a4bdfff656f5918b125d043ced /src/hashtab.c | |
parent | 465de3a57b815f1188c707e7c083950c81652536 (diff) |
patch 9.0.1099: trying to resize a hashtab may cause a problemv9.0.1099
Problem: Trying to resize a hashtab may cause a problem.
Solution: Do not try to resize a hashtab before adding an item.
Diffstat (limited to 'src/hashtab.c')
-rw-r--r-- | src/hashtab.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hashtab.c b/src/hashtab.c index dc4ef8888b..8c25c818b2 100644 --- a/src/hashtab.c +++ b/src/hashtab.c @@ -249,7 +249,7 @@ hash_add_item( hash_T hash) { // If resizing failed before and it fails again we can't add an item. - if ((ht->ht_flags & HTFLAGS_ERROR) && hash_may_resize(ht, 0) == FAIL) + if (ht->ht_flags & HTFLAGS_ERROR) return FAIL; ++ht->ht_used; |