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.
2ddb89f8a9

Changes in ex_retab are N/A (behind a non-FEAT_) and have been dropped.
This commit is contained in:
f380cedric 2022-01-18 10:00:30 +01:00
parent 5e81687d9a
commit 503e6f7832

View File

@ -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;