0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 7.4.1744

Problem:    Python: Converting a sequence may leak memory.
Solution:   Decrement a reference. (Nikolay Pavlov)
This commit is contained in:
Bram Moolenaar
2016-04-15 20:40:41 +02:00
parent 75be2339d8
commit 6621004289
2 changed files with 5 additions and 2 deletions

View File

@@ -6070,7 +6070,7 @@ ConvertFromPyMapping(PyObject *obj, typval_T *tv)
ConvertFromPySequence(PyObject *obj, typval_T *tv) ConvertFromPySequence(PyObject *obj, typval_T *tv)
{ {
PyObject *lookup_dict; PyObject *lookup_dict;
int ret = 0; int ret;
if (!(lookup_dict = PyDict_New())) if (!(lookup_dict = PyDict_New()))
return -1; return -1;
@@ -6080,9 +6080,10 @@ ConvertFromPySequence(PyObject *obj, typval_T *tv)
tv->v_type = VAR_LIST; tv->v_type = VAR_LIST;
tv->vval.v_list = (((ListObject *)(obj))->list); tv->vval.v_list = (((ListObject *)(obj))->list);
++tv->vval.v_list->lv_refcount; ++tv->vval.v_list->lv_refcount;
ret = 0;
} }
else if (PyIter_Check(obj) || PySequence_Check(obj)) 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 else
{ {
PyErr_FORMAT(PyExc_TypeError, PyErr_FORMAT(PyExc_TypeError,

View File

@@ -748,6 +748,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 */
/**/
1744,
/**/ /**/
1743, 1743,
/**/ /**/