summaryrefslogtreecommitdiffstats
path: root/src/if_py_both.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-06-02 18:07:37 +0200
committerBram Moolenaar <Bram@vim.org>2013-06-02 18:07:37 +0200
commit4f2109d782f91f7341a51644e3629ad1cbaea991 (patch)
treebf328821ed5576ec0a7353762ebaa420e5d02ed1 /src/if_py_both.h
parentbc41196bdc94f5025a5d0bee2dcbb3c63aef15b8 (diff)
updated for version 7.3.1098v7.3.1098
Problem: Python: Possible memory leaks Solution: Add Py_XDECREF() calls. (ZyX)
Diffstat (limited to 'src/if_py_both.h')
-rw-r--r--src/if_py_both.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index eedbf1ca2d..21bf069c8c 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -1017,6 +1017,7 @@ _DictionaryItem(DictionaryObject *self, PyObject *args, int flags)
if (*key == NUL)
{
RAISE_NO_EMPTY_KEYS;
+ Py_XDECREF(todecref);
return NULL;
}
@@ -1160,6 +1161,7 @@ DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObje
if (!(key = StringToChars(keyObject, &todecref)))
return -1;
+
if (*key == NUL)
{
RAISE_NO_EMPTY_KEYS;
@@ -2216,9 +2218,11 @@ OptionsItem(OptionsObject *self, PyObject *keyObject)
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, PyObject *keyObject, PyObject *valObject)
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, PyObject *lookup_dict)
dict_unref(dict);
return -1;
}
+
if (*key == NUL)
{
dict_unref(dict);
@@ -4651,6 +4658,7 @@ pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict)
dict_unref(dict);
return -1;
}
+
if (*key == NUL)
{
Py_DECREF(keyObject);