aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-12 06:55:23 -0500
committerGitHub <noreply@github.com>2016-12-12 06:55:23 -0500
commit75c18b6aaa8430596fa10466dc7918047b13ff2b (patch)
treede209e29c240db99f8417b715ef3d9ceb60b513c /src
parent8995a15b204106c7e127129717651047acd5a6dd (diff)
parent79c711670c11b395a3d78d2782e109eb04f4331e (diff)
downloadrneovim-75c18b6aaa8430596fa10466dc7918047b13ff2b.tar.gz
rneovim-75c18b6aaa8430596fa10466dc7918047b13ff2b.tar.bz2
rneovim-75c18b6aaa8430596fa10466dc7918047b13ff2b.zip
Merge pull request #5756 from jamessan/viminfo-leak
option.c: Update free_oldval after adjusting opt_idx for shada/viminfo
Diffstat (limited to 'src')
-rw-r--r--src/nvim/option.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 469aeecc23..797dd1dfe7 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2770,6 +2770,10 @@ did_set_string_option (
? ((shada_idx = findoption((char_u *) "shada")))
: shada_idx)
: opt_idx);
+ // Update free_oldval now that we have the opt_idx for 'shada', otherwise
+ // there would be a disconnect between the check for P_ALLOCED at the start
+ // of the function and the set of P_ALLOCED at the end of the fuction.
+ free_oldval = (options[opt_idx].flags & P_ALLOCED);
for (s = p_shada; *s; ) {
/* Check it's a valid character */
if (vim_strchr((char_u *)"!\"%'/:<@cfhnrs", *s) == NULL) {