mirror of
https://github.com/neovim/neovim.git
synced 2026-09-25 14:58:32 +00:00
vim-patch:8.2.2458: Coverity warns for :retab using freed memory
Problem: Coverity warns for :retab using freed memory. Solution: Use the updated line pointer when moving text properties. https://github.com/vim/vim/commit/0dcd39bad5e5aa70ba8f60cb3fbf0658585f0151 N/A patches for version.c: vim-patch:8.2.2457: Coverity warns for memory leak Problem: Coverity warns for memory leak. Solution: Free memory when out of memory. https://github.com/vim/vim/commit/4dba04256b8a49b201d685217d3d7abc4988f090
This commit is contained in:
+4
-1
@@ -790,7 +790,10 @@ void ex_retab(exarg_T *eap)
|
||||
for (col = 0; col < len; col++) {
|
||||
ptr[col] = (col < num_tabs) ? '\t' : ' ';
|
||||
}
|
||||
ml_replace(lnum, new_line, false);
|
||||
if (ml_replace(lnum, new_line, false) == OK) {
|
||||
// "new_line" may have been copied
|
||||
new_line = curbuf->b_ml.ml_line_ptr;
|
||||
}
|
||||
if (first_line == 0) {
|
||||
first_line = lnum;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user