To: vim_dev@googlegroups.com Subject: Patch 8.2.0825 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0825 Problem: def_function() may return pointer that was freed. Solution: Set "fp" to NULL after freeing it. Files: src/userfunc.c *** ../vim-8.2.0824/src/userfunc.c 2020-05-25 22:36:46.629735032 +0200 --- src/userfunc.c 2020-05-25 23:07:16.604423874 +0200 *************** *** 3140,3151 **** --- 3140,3153 ---- if (fudi.fd_di == NULL) { vim_free(fp); + fp = NULL; goto erret; } if (dict_add(fudi.fd_dict, fudi.fd_di) == FAIL) { vim_free(fudi.fd_di); vim_free(fp); + fp = NULL; goto erret; } } *************** *** 3169,3174 **** --- 3171,3177 ---- else if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL) { vim_free(fp); + fp = NULL; goto erret; } fp->uf_refcount = 1; *** ../vim-8.2.0824/src/version.c 2020-05-25 23:01:38.781393409 +0200 --- src/version.c 2020-05-25 23:28:48.084239779 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 825, /**/ -- hundred-and-one symptoms of being an internet addict: 178. You look for an icon to double-click to open your bedroom window. /// 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 ///