From: Bram Moolenaar Date: Fri, 25 Mar 2022 14:46:47 +0000 (+0000) Subject: patch 8.2.4624: old Coverity warning for resource leak X-Git-Tag: v8.2.4624 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5d46dcfeed4fcbbab371e17e1072b0cc9abe5217;p=vim 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. --- diff --git a/src/diff.c b/src/diff.c index 4136d99b4..00ccdb611 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 (;;) diff --git a/src/version.c b/src/version.c index c7164f489..4a20c4665 100644 --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 4624, /**/ 4623, /**/