0
0
mirror of https://github.com/vim/vim.git synced 2025-09-15 23:23:38 -04:00

updated for version 7.3.670

Problem:    Python: memory leaks when there are exceptions.
Solution:   Add DICTKEY_UNREF in the right places. (ZyX)
This commit is contained in:
Bram Moolenaar 2012-09-21 13:43:14 +02:00
parent f94a13c286
commit 696c2116dc
2 changed files with 6 additions and 2 deletions

View File

@ -799,14 +799,14 @@ DictionaryItem(PyObject *self, PyObject *keyObject)
di = dict_find(((DictionaryObject *) (self))->dict, key, -1);
DICTKEY_UNREF
if (di == NULL)
{
PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
return NULL;
}
DICTKEY_UNREF
return ConvertToPyObject(&di->di_tv);
}
@ -835,6 +835,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
if (di == NULL)
{
DICTKEY_UNREF
PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
return -1;
}
@ -859,6 +860,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
if (dict_add(d, di) == FAIL)
{
DICTKEY_UNREF
vim_free(di);
PyErr_SetVim(_("failed to add key to dictionary"));
return -1;

View File

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