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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui