0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

updated for version 7.3.1098

Problem:    Python: Possible memory leaks
Solution:   Add Py_XDECREF() calls. (ZyX)
This commit is contained in:
Bram Moolenaar
2013-06-02 18:07:37 +02:00
parent bc41196bdc
commit 4f2109d782
2 changed files with 10 additions and 0 deletions

View File

@@ -1017,6 +1017,7 @@ _DictionaryItem(DictionaryObject *self, PyObject *args, int flags)
if (*key == NUL) if (*key == NUL)
{ {
RAISE_NO_EMPTY_KEYS; RAISE_NO_EMPTY_KEYS;
Py_XDECREF(todecref);
return NULL; return NULL;
} }
@@ -1160,6 +1161,7 @@ DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObje
if (!(key = StringToChars(keyObject, &todecref))) if (!(key = StringToChars(keyObject, &todecref)))
return -1; return -1;
if (*key == NUL) if (*key == NUL)
{ {
RAISE_NO_EMPTY_KEYS; RAISE_NO_EMPTY_KEYS;
@@ -2216,9 +2218,11 @@ OptionsItem(OptionsObject *self, PyObject *keyObject)
if (!(key = StringToChars(keyObject, &todecref))) if (!(key = StringToChars(keyObject, &todecref)))
return NULL; return NULL;
if (*key == NUL) if (*key == NUL)
{ {
RAISE_NO_EMPTY_KEYS; RAISE_NO_EMPTY_KEYS;
Py_XDECREF(todecref);
return NULL; return NULL;
} }
@@ -2349,9 +2353,11 @@ OptionsAssItem(OptionsObject *self, PyObject *keyObject, PyObject *valObject)
if (!(key = StringToChars(keyObject, &todecref))) if (!(key = StringToChars(keyObject, &todecref)))
return -1; return -1;
if (*key == NUL) if (*key == NUL)
{ {
RAISE_NO_EMPTY_KEYS; RAISE_NO_EMPTY_KEYS;
Py_XDECREF(todecref);
return -1; return -1;
} }
@@ -4568,6 +4574,7 @@ pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict)
dict_unref(dict); dict_unref(dict);
return -1; return -1;
} }
if (*key == NUL) if (*key == NUL)
{ {
dict_unref(dict); dict_unref(dict);
@@ -4651,6 +4658,7 @@ pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict)
dict_unref(dict); dict_unref(dict);
return -1; return -1;
} }
if (*key == NUL) if (*key == NUL)
{ {
Py_DECREF(keyObject); Py_DECREF(keyObject);

View File

@@ -728,6 +728,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1098,
/**/ /**/
1097, 1097,
/**/ /**/