Mercurial > vim
changeset 4702:26f2dbea7443 v7.3.1098
updated for version 7.3.1098
Problem: Python: Possible memory leaks
Solution: Add Py_XDECREF() calls. (ZyX)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 02 Jun 2013 18:07:37 +0200 |
parents | df660cd6fac4 |
children | 2d9d2b3b10b8 |
files | src/if_py_both.h src/version.c |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -1017,6 +1017,7 @@ DictionaryLength(DictionaryObject *self) if (*key == NUL) { RAISE_NO_EMPTY_KEYS; + Py_XDECREF(todecref); return NULL; } @@ -1160,6 +1161,7 @@ DictionaryAssItem(DictionaryObject *self if (!(key = StringToChars(keyObject, &todecref))) return -1; + if (*key == NUL) { RAISE_NO_EMPTY_KEYS; @@ -2216,9 +2218,11 @@ OptionsItem(OptionsObject *self, PyObjec if (!(key = StringToChars(keyObject, &todecref))) return NULL; + if (*key == NUL) { RAISE_NO_EMPTY_KEYS; + Py_XDECREF(todecref); return NULL; } @@ -2349,9 +2353,11 @@ OptionsAssItem(OptionsObject *self, PyOb if (!(key = StringToChars(keyObject, &todecref))) return -1; + if (*key == NUL) { RAISE_NO_EMPTY_KEYS; + Py_XDECREF(todecref); return -1; } @@ -4568,6 +4574,7 @@ pydict_to_tv(PyObject *obj, typval_T *tv dict_unref(dict); return -1; } + if (*key == NUL) { dict_unref(dict); @@ -4651,6 +4658,7 @@ pymap_to_tv(PyObject *obj, typval_T *tv, dict_unref(dict); return -1; } + if (*key == NUL) { Py_DECREF(keyObject);