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

patch 8.2.2457: Coverity warns for memory leak

Problem:    Coverity warns for memory leak.
Solution:   Free memory when out of memory.
This commit is contained in:
Bram Moolenaar 2021-02-03 19:35:13 +01:00
parent 7b6903f02c
commit 4dba04256b
2 changed files with 5 additions and 0 deletions

View File

@ -1813,7 +1813,10 @@ cs_file_results(FILE *f, int *nummatches_a)
context = alloc(strlen(cntx)+5);
if (context == NULL)
{
vim_free(fullname);
continue;
}
if (strcmp(cntx, "<global>")==0)
strcpy(context, "<<global>>");

View File

@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2457,
/**/
2456,
/**/