summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-03-25 14:46:47 +0000
committerBram Moolenaar <Bram@vim.org>2022-03-25 14:46:47 +0000
commit5d46dcfeed4fcbbab371e17e1072b0cc9abe5217 (patch)
tree5d7ffba43376d501d33898ddf3b8672d9c6cfcd8 /src/diff.c
parent03a297c63f1512ba9783104a343dc7e2024e0bb0 (diff)
patch 8.2.4624: old Coverity warning for resource leakv8.2.4624
Problem: Old Coverity warning for resource leak. Solution: Close the file if memory allocation fails.
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/diff.c b/src/diff.c
index 4136d99b44..00ccdb611f 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1662,7 +1662,11 @@ diff_read(
{
hunk = ALLOC_ONE(diffhunk_T);
if (hunk == NULL)
+ {
+ if (fd != NULL)
+ fclose(fd);
return;
+ }
}
for (;;)