0
0
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:
Bram Moolenaar
2019-12-23 18:18:52 +01:00
parent 7c77b34967
commit 70188f5b23
2 changed files with 7 additions and 1 deletions

View File

@@ -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 (;;)
{