Problem: Python: memory leaks when there are exceptions.
Solution: Add DICTKEY_UNREF in the right places. (ZyX)
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);
}
if (di == NULL)
{
+ DICTKEY_UNREF
PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
return -1;
}
if (dict_add(d, di) == FAIL)
{
+ DICTKEY_UNREF
vim_free(di);
PyErr_SetVim(_("failed to add key to dictionary"));
return -1;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 670,
/**/
669,
/**/