From 0ba2ec0bae0653e10cd8ba2e2a7bc920b05b4849 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 22 Apr 2018 19:54:40 +0300 Subject: spellfile: Fix PVS/V560: allocator never returns NULL now --- src/nvim/spellfile.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c index f5d5d408a1..318d289ce8 100644 --- a/src/nvim/spellfile.c +++ b/src/nvim/spellfile.c @@ -3761,6 +3761,7 @@ static void free_blocks(sblock_T *bl) // Allocate the root of a word tree. // Returns NULL when out of memory. static wordnode_T *wordtree_alloc(spellinfo_T *spin) + FUNC_ATTR_NONNULL_RET { return (wordnode_T *)getroom(spin, sizeof(wordnode_T), true); } @@ -5183,12 +5184,6 @@ mkspell ( spin.si_foldroot = wordtree_alloc(&spin); spin.si_keeproot = wordtree_alloc(&spin); spin.si_prefroot = wordtree_alloc(&spin); - if (spin.si_foldroot == NULL - || spin.si_keeproot == NULL - || spin.si_prefroot == NULL) { - free_blocks(spin.si_blocks); - goto theend; - } // When not producing a .add.spl file clear the character table when // we encounter one in the .aff file. This means we dump the current -- cgit