summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-12-29 11:59:53 +0000
committerBram Moolenaar <Bram@vim.org>2021-12-29 11:59:53 +0000
commitfebb78fa1798e0f95983b3f7881419a754886df5 (patch)
treedc127471312decf514a729a7d1cfb028f39e690d /src/diff.c
parentc97f9a55bd020b94d92c392516d763ed5e43d872 (diff)
downloadvim-git-febb78fa1798e0f95983b3f7881419a754886df5.tar.gz
patch 8.2.3931: Coverity reports a memory leakv8.2.3931
Problem: Coverity reports a memory leak. Solution: Free memory in case of failure.
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/diff.c b/src/diff.c
index 9fb8726b4..d42233889 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -3310,7 +3310,10 @@ xdiff_out(
return -1;
if (ga_grow(&dout->dout_ga, 1) == FAIL)
+ {
+ vim_free(p);
return -1;
+ }
p->lnum_orig = start_a + 1;
p->count_orig = count_a;