0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.1.2116: no check for out of memory

Problem:    No check for out of memory.
Solution:   Check for NULL pointer.
This commit is contained in:
Bram Moolenaar
2019-10-05 21:35:16 +02:00
parent 2efc44b3f0
commit 1671de3098
2 changed files with 8 additions and 3 deletions

View File

@@ -112,9 +112,12 @@ set_init_1(int clean_arg)
{ {
len = STRLEN(p) + 3; // two quotes and a trailing NUL len = STRLEN(p) + 3; // two quotes and a trailing NUL
cmd = alloc(len); cmd = alloc(len);
vim_snprintf((char *)cmd, len, "\"%s\"", p); if (cmd != NULL)
set_string_default("sh", cmd); {
vim_free(cmd); vim_snprintf((char *)cmd, len, "\"%s\"", p);
set_string_default("sh", cmd);
vim_free(cmd);
}
} }
else else
set_string_default("sh", p); set_string_default("sh", p);

View File

@@ -753,6 +753,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 */
/**/
2116,
/**/ /**/
2115, 2115,
/**/ /**/