patch 9.2.0243: memory leak in change_indent()
Commit:
https://github.com/vim/vim/commit/0effd2faf9527d803e3cc86e2a250009c3b005ce
Author: Huihui Huang <[email protected]>
Date: Wed Mar 25 19:18:20 2026 +0000
patch 9.2.0243: memory leak in change_indent()
Problem: memory leak in change_indent()
Solution: Free orig_line in the error case
(Huihui Huang)
closes: #19820
Signed-off-by: Huihui Huang <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/indent.c b/src/indent.c
index e31da232a..26f60701c 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1513,7 +1513,10 @@ change_indent(
// Save new line
new_line = vim_strnsave(ml_get_curline(), ml_get_curline_len());
if (new_line == NULL)
+ {
+ vim_free(orig_line);
return;
+ }
// We only put back the new line up to the cursor
new_line[curwin->w_cursor.col] = NUL;
diff --git a/src/version.c b/src/version.c
index 003ddcacb..75ff30ec9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 243,
/**/
242,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1w5TvX-005kRT-Ls%40256bit.org.