mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.0034: missing check for out of memory
Problem: Missing check for out of memory. Solution: Check for NULL after vim_strsave(). (Dominique Pelle, closes #5393)
This commit is contained in:
@@ -1658,7 +1658,8 @@ f_resolve(typval_T *argvars, typval_T *rettv)
|
||||
int limit = 100;
|
||||
|
||||
p = vim_strsave(p);
|
||||
|
||||
if (p == NULL)
|
||||
goto fail;
|
||||
if (p[0] == '.' && (vim_ispathsep(p[1])
|
||||
|| (p[1] == '.' && (vim_ispathsep(p[2])))))
|
||||
is_relative_to_current = TRUE;
|
||||
@@ -1681,7 +1682,10 @@ f_resolve(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
buf = alloc(MAXPATHL + 1);
|
||||
if (buf == NULL)
|
||||
{
|
||||
vim_free(p);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
@@ -742,6 +742,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
34,
|
||||
/**/
|
||||
33,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user