diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-13 13:27:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-13 13:27:50 +0800 |
commit | 99c1010aa740b76df341a756231e99d0116fc3be (patch) | |
tree | b8dfe23f1db78c367a0ddc98d645689a6f116cc7 | |
parent | 5ccec143d808239bff1b6ea9da79d61cedbb094a (diff) | |
download | rneovim-99c1010aa740b76df341a756231e99d0116fc3be.tar.gz rneovim-99c1010aa740b76df341a756231e99d0116fc3be.tar.bz2 rneovim-99c1010aa740b76df341a756231e99d0116fc3be.zip |
vim-patch:partial:9.0.0364: clang static analyzer gives warnings (#23059)
Problem: Clang static analyzer gives warnings.
Solution: Avoid the warnings. (Yegappan Lakshmanan, closes vim/vim#11043)
https://github.com/vim/vim/commit/c99e182e1fb54e39540d25d0ccd8dcdde25bb96c
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
-rw-r--r-- | src/nvim/tag.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/tag.c b/src/nvim/tag.c index 401b43204e..cebc7d5d89 100644 --- a/src/nvim/tag.c +++ b/src/nvim/tag.c @@ -3322,11 +3322,10 @@ int get_tags(list_T *list, char *pat, char *buf_fname) } for (i = 0; i < num_matches; i++) { - int parse_result = parse_match(matches[i], &tp); - - // Avoid an unused variable warning in release builds. - (void)parse_result; - assert(parse_result == OK); + if (parse_match(matches[i], &tp) == FAIL) { + xfree(matches[i]); + continue; + } bool is_static = test_for_static(&tp); |