mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 7.4.989
Problem: Leaking memory when hash_add() fails. Coverity error 99126. Solution: When hash_add() fails free the memory.
This commit is contained in:
@@ -23095,7 +23095,11 @@ ex_function(eap)
|
|||||||
|
|
||||||
/* insert the new function in the function list */
|
/* insert the new function in the function list */
|
||||||
STRCPY(fp->uf_name, name);
|
STRCPY(fp->uf_name, name);
|
||||||
hash_add(&func_hashtab, UF2HIKEY(fp));
|
if (hash_add(&func_hashtab, UF2HIKEY(fp)) == FAIL)
|
||||||
|
{
|
||||||
|
vim_free(fp);
|
||||||
|
goto erret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fp->uf_args = newargs;
|
fp->uf_args = newargs;
|
||||||
fp->uf_lines = newlines;
|
fp->uf_lines = newlines;
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
989,
|
||||||
/**/
|
/**/
|
||||||
988,
|
988,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user