summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-15 20:40:41 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-15 20:40:41 +0200
commit66210042892389d36e3d37203ec77f61467bfb1c (patch)
tree6fae45292e7d8cb3b9bdd898f92f79045803743d
parent75be2339d877bbd38df91c0181e1e0e388852df6 (diff)
downloadvim-git-66210042892389d36e3d37203ec77f61467bfb1c.tar.gz
patch 7.4.1744v7.4.1744
Problem: Python: Converting a sequence may leak memory. Solution: Decrement a reference. (Nikolay Pavlov)
-rw-r--r--src/if_py_both.h5
-rw-r--r--src/version.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 0b701ae08..c6a8c4463 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -6070,7 +6070,7 @@ ConvertFromPyMapping(PyObject *obj, typval_T *tv)
ConvertFromPySequence(PyObject *obj, typval_T *tv)
{
PyObject *lookup_dict;
- int ret = 0;
+ int ret;
if (!(lookup_dict = PyDict_New()))
return -1;
@@ -6080,9 +6080,10 @@ ConvertFromPySequence(PyObject *obj, typval_T *tv)
tv->v_type = VAR_LIST;
tv->vval.v_list = (((ListObject *)(obj))->list);
++tv->vval.v_list->lv_refcount;
+ ret = 0;
}
else if (PyIter_Check(obj) || PySequence_Check(obj))
- return convert_dl(obj, tv, pyseq_to_tv, lookup_dict);
+ ret = convert_dl(obj, tv, pyseq_to_tv, lookup_dict);
else
{
PyErr_FORMAT(PyExc_TypeError,
diff --git a/src/version.c b/src/version.c
index aa181fb22..1dd7d4985 100644
--- a/src/version.c
+++ b/src/version.c
@@ -749,6 +749,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1744,
+/**/
1743,
/**/
1742,