To: vim_dev@googlegroups.com Subject: Patch 7.4.1744 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1744 Problem: Python: Converting a sequence may leak memory. Solution: Decrement a reference. (Nikolay Pavlov) Files: src/if_py_both.h *** ../vim-7.4.1743/src/if_py_both.h 2016-04-14 23:10:35.644383092 +0200 --- src/if_py_both.h 2016-04-15 20:37:53.920954094 +0200 *************** *** 6070,6076 **** ConvertFromPySequence(PyObject *obj, typval_T *tv) { PyObject *lookup_dict; ! int ret = 0; if (!(lookup_dict = PyDict_New())) return -1; --- 6070,6076 ---- ConvertFromPySequence(PyObject *obj, typval_T *tv) { PyObject *lookup_dict; ! int ret; if (!(lookup_dict = PyDict_New())) return -1; *************** *** 6080,6088 **** tv->v_type = VAR_LIST; tv->vval.v_list = (((ListObject *)(obj))->list); ++tv->vval.v_list->lv_refcount; } else if (PyIter_Check(obj) || PySequence_Check(obj)) ! return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); else { PyErr_FORMAT(PyExc_TypeError, --- 6080,6089 ---- 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)) ! ret = convert_dl(obj, tv, pyseq_to_tv, lookup_dict); else { PyErr_FORMAT(PyExc_TypeError, *** ../vim-7.4.1743/src/version.c 2016-04-14 23:10:35.644383092 +0200 --- src/version.c 2016-04-15 20:38:40.776453441 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1744, /**/ -- Microsoft's definition of a boolean: TRUE, FALSE, MAYBE "Embrace and extend"...? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///