mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
ins_compl_add_tv: fix memory leaks via get_spec_reg (#8224)
Fixes #8186
This commit is contained in:
parent
60e96a45b4
commit
e40e300c16
@ -3615,6 +3615,9 @@ int ins_compl_add_tv(typval_T *const tv, const Direction dir)
|
|||||||
memset(cptext, 0, sizeof(cptext));
|
memset(cptext, 0, sizeof(cptext));
|
||||||
}
|
}
|
||||||
if (word == NULL || (!aempty && *word == NUL)) {
|
if (word == NULL || (!aempty && *word == NUL)) {
|
||||||
|
for (size_t i = 0; i < CPT_COUNT; i++) {
|
||||||
|
xfree(cptext[i]);
|
||||||
|
}
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
return ins_compl_add((char_u *)word, -1, icase, NULL,
|
return ins_compl_add((char_u *)word, -1, icase, NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user