Mercurial > vim
changeset 5525:3fbda56bb200 v7.4.111
updated for version 7.4.111
Problem: Memory leak in Python OptionsAssItem. (Ken Takata)
Solution: Call Py_XDECREF() where needed. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 07 Dec 2013 14:28:43 +0100 |
parents | 486655e0c5a2 |
children | 5b3b1af58c4e |
files | src/if_py_both.h src/version.c |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -3005,11 +3005,14 @@ OptionsAssItem(OptionsObject *self, PyOb else { char_u *val; - PyObject *todecref; - - if ((val = StringToChars(valObject, &todecref))) + PyObject *todecref2; + + if ((val = StringToChars(valObject, &todecref2))) + { ret = set_option_value_for(key, 0, val, opt_flags, self->opt_type, self->from); + Py_XDECREF(todecref2); + } else ret = -1; }