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

patch 8.2.4624: old Coverity warning for resource leak

Problem:    Old Coverity warning for resource leak.
Solution:   Close the file if memory allocation fails.
This commit is contained in:
Bram Moolenaar 2022-03-25 14:46:47 +00:00
parent 03a297c63f
commit 5d46dcfeed
2 changed files with 6 additions and 0 deletions

View File

@ -1662,7 +1662,11 @@ diff_read(
{
hunk = ALLOC_ONE(diffhunk_T);
if (hunk == NULL)
{
if (fd != NULL)
fclose(fd);
return;
}
}
for (;;)

View File

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