From: Bram Moolenaar Date: Fri, 15 Apr 2016 18:40:41 +0000 (+0200) Subject: patch 7.4.1744 X-Git-Tag: v7.4.1744 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=66210042892389d36e3d37203ec77f61467bfb1c;p=vim patch 7.4.1744 Problem: Python: Converting a sequence may leak memory. Solution: Decrement a reference. (Nikolay Pavlov) --- 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 @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1744, /**/ 1743, /**/