To: vim_dev@googlegroups.com Subject: Patch 7.4.989 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.989 Problem: Leaking memory when hash_add() fails. Coverity error 99126. Solution: When hash_add() fails free the memory. Files: src/eval.c *** ../vim-7.4.988/src/eval.c 2015-12-28 19:19:41.546241839 +0100 --- src/eval.c 2015-12-28 22:47:10.110019654 +0100 *************** *** 23095,23101 **** /* insert the new function in the function list */ STRCPY(fp->uf_name, name); ! hash_add(&func_hashtab, UF2HIKEY(fp)); } fp->uf_args = newargs; fp->uf_lines = newlines; --- 23095,23105 ---- /* insert the new function in the function list */ STRCPY(fp->uf_name, name); ! if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL) ! { ! vim_free(fp); ! goto erret; ! } } fp->uf_args = newargs; fp->uf_lines = newlines; *** ../vim-7.4.988/src/version.c 2015-12-28 22:24:37.392781734 +0100 --- src/version.c 2015-12-28 22:48:41.001027519 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 989, /**/ -- Have you heard about the new Barbie doll? It's called Divorce Barbie. It comes with all of Ken's stuff. /// 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 ///