aboutsummaryrefslogtreecommitdiffstats
path: root/tree-diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-23 13:44:49 -0700
committerJunio C Hamano <gitster@pobox.com>2021-09-23 13:44:49 -0700
commit50eb005eb371723704024c656da60a2c37658945 (patch)
treef566eee43e7299119a16c311ad1abadc78d6c0e9 /tree-diff.c
parentMerge branch 'jt/submodule-name-to-gitdir' (diff)
parentt0000: avoid masking git exit value through pipes (diff)
downloadgit-50eb005eb371723704024c656da60a2c37658945.tar.gz
git-50eb005eb371723704024c656da60a2c37658945.zip
Merge branch 'cb/plug-leaks-in-alloca-emu-users'
Leakfix. * cb/plug-leaks-in-alloca-emu-users: t0000: avoid masking git exit value through pipes tree-diff: fix leak when not HAVE_ALLOCA_H
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 1572615bd9..437c98a70e 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -21,7 +21,9 @@
ALLOC_ARRAY((x), nr); \
} while(0)
#define FAST_ARRAY_FREE(x, nr) do { \
- if ((nr) > 2) \
+ if ((nr) <= 2) \
+ xalloca_free((x)); \
+ else \
free((x)); \
} while(0)