diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-09-21 13:43:14 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-09-21 13:43:14 +0200 |
commit | 696c2116dc5e5403644d7f7dcaea49b83cf5a8f5 (patch) | |
tree | 4fa5357f0cb56d8682c2be631c576448b608acd5 /src | |
parent | f94a13c286ffcf1ba2ce7bf10d686c757c836fe0 (diff) |
updated for version 7.3.670v7.3.670
Problem: Python: memory leaks when there are exceptions.
Solution: Add DICTKEY_UNREF in the right places. (ZyX)
Diffstat (limited to 'src')
-rw-r--r-- | src/if_py_both.h | 6 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 5e12638f5e..c8a7fca7f8 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -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; diff --git a/src/version.c b/src/version.c index 6ac25907c2..4fb2743957 100644 --- a/src/version.c +++ b/src/version.c @@ -720,6 +720,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 670, +/**/ 669, /**/ 668, |