aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-08-05 22:33:50 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2019-08-05 22:40:48 -0400
commitce7bcdec239a723a2f696df8673cb73cbc31b477 (patch)
tree1d2431b583cbe8ae6f1d3c3bcbf87e3cc9578929
parent067a39ba854cc02a750911ead968a744b2769aac (diff)
downloadrneovim-ce7bcdec239a723a2f696df8673cb73cbc31b477.tar.gz
rneovim-ce7bcdec239a723a2f696df8673cb73cbc31b477.tar.bz2
rneovim-ce7bcdec239a723a2f696df8673cb73cbc31b477.zip
vim-patch:8.1.1465: allocating wrong amount of memory
Problem: Allocating wrong amount of memory. (Yegappan Lakshmanan) Solution: Use sizeof() for right type of struct. https://github.com/vim/vim/commit/a37833dbd7d3cb0fff4cbf0ba6e80d0ad55cd4b9
-rw-r--r--src/nvim/testdir/samples/memfile_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/testdir/samples/memfile_test.c b/src/nvim/testdir/samples/memfile_test.c
index 3c8f108255..c71a5c8f40 100644
--- a/src/nvim/testdir/samples/memfile_test.c
+++ b/src/nvim/testdir/samples/memfile_test.c
@@ -70,7 +70,7 @@ test_mf_hash(void)
assert(mf_hash_find(&ht, key) == NULL);
/* allocate and add new item */
- item = (mf_hashitem_T *)lalloc_clear(sizeof(mf_hashtab_T), FALSE);
+ item = (mf_hashitem_T *)lalloc_clear(sizeof(*item), FALSE);
assert(item != NULL);
item->mhi_key = key;
mf_hash_add_item(&ht, item);