diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-06-02 18:54:21 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-06-02 18:54:21 +0200 |
commit | 78b595743931457c054156f1c86aa1fae8ba42f5 (patch) | |
tree | 2c36021e276811942b86370ff42e3ebd31135c72 /src/if_py_both.h | |
parent | f4258308e288c82c30d35cb2d0e045e60bfdb21c (diff) |
updated for version 7.3.1100v7.3.1100
Problem: Python: a few more memory problems.
Solution: Add and remove Py_XDECREF(). (ZyX)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r-- | src/if_py_both.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 73fa56cbc9..99fdd80ce5 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -1236,6 +1236,7 @@ DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObje if (*key == NUL) { RAISE_NO_EMPTY_KEYS; + Py_XDECREF(todecref); return -1; } @@ -1254,11 +1255,15 @@ DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObje hi = hash_find(&dict->dv_hashtab, di->di_key); hash_remove(&dict->dv_hashtab, hi); dictitem_free(di); + Py_XDECREF(todecref); return 0; } if (ConvertFromPyObject(valObject, &tv) == -1) + { + Py_XDECREF(todecref); return -1; + } if (di == NULL) { @@ -2505,11 +2510,8 @@ OptionsAssItem(OptionsObject *self, PyObject *keyObject, PyObject *valObject) PyObject *todecref; if ((val = StringToChars(valObject, &todecref))) - { r = set_option_value_for(key, 0, val, opt_flags, self->opt_type, self->from); - Py_XDECREF(todecref); - } else r = -1; } |