]> granicus.if.org Git - vim/commitdiff
patch 7.4.1744 v7.4.1744
authorBram Moolenaar <Bram@vim.org>
Fri, 15 Apr 2016 18:40:41 +0000 (20:40 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 15 Apr 2016 18:40:41 +0000 (20:40 +0200)
Problem:    Python: Converting a sequence may leak memory.
Solution:   Decrement a reference. (Nikolay Pavlov)

src/if_py_both.h
src/version.c

index 0b701ae082bbfc4c1ad04866b70ca0ce150a1555..c6a8c44635513c563583d46793c8aeea876c2300 100644 (file)
@@ -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,
index aa181fb22c246cf1c5aea8c5e782c3c98c01b035..1dd7d49859574d31ac19b26a10d389b172e8f378 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1744,
 /**/
     1743,
 /**/