mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -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:
@@ -1662,7 +1662,11 @@ diff_read(
|
||||
{
|
||||
hunk = ALLOC_ONE(diffhunk_T);
|
||||
if (hunk == NULL)
|
||||
{
|
||||
if (fd != NULL)
|
||||
fclose(fd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (;;)
|
||||
|
Reference in New Issue
Block a user