From ce7bcdec239a723a2f696df8673cb73cbc31b477 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 5 Aug 2019 22:33:50 -0400 Subject: 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 --- src/nvim/testdir/samples/memfile_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit