aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2018-04-22 19:54:40 +0300
committerZyX <kp-pav@yandex.ru>2018-04-22 19:54:40 +0300
commit0ba2ec0bae0653e10cd8ba2e2a7bc920b05b4849 (patch)
tree0558c557b2d8aca04ff28334d0908949bf8f6b67
parent60577eeaf5b7a542e7f7004bb0cd9a48b294c37d (diff)
downloadrneovim-0ba2ec0bae0653e10cd8ba2e2a7bc920b05b4849.tar.gz
rneovim-0ba2ec0bae0653e10cd8ba2e2a7bc920b05b4849.tar.bz2
rneovim-0ba2ec0bae0653e10cd8ba2e2a7bc920b05b4849.zip
spellfile: Fix PVS/V560: allocator never returns NULL now
-rw-r--r--src/nvim/spellfile.c7
1 files changed, 1 insertions, 6 deletions
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