changeset 12190:497b78526358 v8.0.0975

patch 8.0.0975: using freed memory when setting 'backspace' commit https://github.com/vim/vim/commit/edbc0d46cffe1766d0b330dc2842212cff644f8e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 20 16:11:51 2017 +0200 patch 8.0.0975: using freed memory when setting 'backspace' Problem: Using freed memory when setting 'backspace'. Solution: When changing oldval also change origval.
author Christian Brabandt <cb@256bit.org>
date Sun, 20 Aug 2017 16:15:04 +0200
parents f19e93e09b42
children fee055edaaef
files src/option.c src/version.c
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -4927,6 +4927,8 @@ do_set(
 					break;
 				}
 				vim_free(oldval);
+				if (origval == oldval)
+				    origval = *(char_u **)varp;
 				oldval = *(char_u **)varp;
 			    }
 			    /*
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    975,
+/**/
     974,
 /**/
     973,