To: vim_dev@googlegroups.com Subject: Patch 8.1.2091 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2091 Problem: Double free when memory allocation fails. (Zu-Ming Jiang) Solution: Use VIM_CLEAR() instead of vim_free(). (closes #4991) Files: src/getchar.c *** ../vim-8.1.2090/src/getchar.c 2019-09-18 21:15:25.409966545 +0200 --- src/getchar.c 2019-09-28 15:21:06.594144273 +0200 *************** *** 1296,1306 **** if (typebuf.tb_buf == typebuf_init) internal_error("Free typebuf 1"); else ! vim_free(typebuf.tb_buf); if (typebuf.tb_noremap == noremapbuf_init) internal_error("Free typebuf 2"); else ! vim_free(typebuf.tb_noremap); } /* --- 1296,1306 ---- if (typebuf.tb_buf == typebuf_init) internal_error("Free typebuf 1"); else ! VIM_CLEAR(typebuf.tb_buf); if (typebuf.tb_noremap == noremapbuf_init) internal_error("Free typebuf 2"); else ! VIM_CLEAR(typebuf.tb_noremap); } /* *** ../vim-8.1.2090/src/version.c 2019-09-27 23:12:41.846038561 +0200 --- src/version.c 2019-09-28 15:23:04.817540486 +0200 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 2091, /**/ -- WOMAN: King of the who? ARTHUR: The Britons. WOMAN: Who are the Britons? ARTHUR: Well, we all are. we're all Britons and I am your king. The Quest for the Holy Grail (Monty Python) /// 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 ///