From 503e6f7832dd07b077b3ae654fd7ae46e905aaf3 Mon Sep 17 00:00:00 2001 From: f380cedric Date: Tue, 18 Jan 2022 10:00:30 +0100 Subject: [PATCH] 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. --- src/nvim/option.c | 2 ++ 1 file changed, 2 insertions(+) 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;