0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

updated for version 7.3.522

Problem:    Crash in vim_realloc() when using MEM_PROFILE.
Solution:   Avoid using a NULL argument. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2012-05-18 18:34:19 +02:00
parent f9de140e7f
commit 455981e69b
2 changed files with 5 additions and 1 deletions

View File

@@ -14643,7 +14643,9 @@ f_readfile(argvars, rettv)
long growmin = (long)((p - start) * 2 + prevlen);
prevsize = grow50pc > growmin ? grow50pc : growmin;
}
if ((newprev = vim_realloc(prev, prevsize)) == NULL)
newprev = prev == NULL ? alloc(prevsize)
: vim_realloc(prev, prevsize);
if (newprev == NULL)
{
do_outofmem_msg((long_u)prevsize);
failed = TRUE;