diff options
author | f380cedric <f380cedric@users.noreply.github.com> | 2022-01-18 10:00:30 +0100 |
---|---|---|
committer | f380cedric <f380cedric@users.noreply.github.com> | 2022-01-27 23:37:01 +0100 |
commit | 503e6f7832dd07b077b3ae654fd7ae46e905aaf3 (patch) | |
tree | 886774e480857d79481328e116297d62d602e18f /src | |
parent | 5e81687d9a4fb5d6fe734756b086aae47d64f5a4 (diff) | |
download | rneovim-503e6f7832dd07b077b3ae654fd7ae46e905aaf3.tar.gz rneovim-503e6f7832dd07b077b3ae654fd7ae46e905aaf3.tar.bz2 rneovim-503e6f7832dd07b077b3ae654fd7ae46e905aaf3.zip |
vim-patch:8.2.3403: memory leak for :retab with invalid argument
Problem: Memory leak for :retab with invalid argument.
Solution: Free the memory. Make error messages consistent.
https://github.com/vim/vim/commit/2ddb89f8a94425cda1e5491efc80c1ccccb6e08e
Changes in ex_retab are N/A (behind a non-FEAT_) and have been dropped.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 9471974d2b..bd76dbda95 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -7513,8 +7513,10 @@ bool tabstop_set(char_u *var, long **array) for (cp = var; *cp != NUL;) { int n = atoi((char *)cp); + // Catch negative values, overflow and ridiculous big values. if (n < 0 || n > 9999) { semsg(_(e_invarg2), cp); + XFREE_CLEAR(*array); return false; } (*array)[t++] = n; |