From: Hiltjo Posthuma Date: Sun, 12 Mar 2017 20:30:43 +0000 (+0100) Subject: fix potential leak, found by clang-analyzer X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=1d91c79e3c26c62bee0c047fe1db02668ca94721;p=forks%2Fstagit.git fix potential leak, found by clang-analyzer --- diff --git a/stagit.c b/stagit.c index 835f6f3..06b6698 100644 --- a/stagit.c +++ b/stagit.c @@ -114,6 +114,7 @@ commitinfo_getstats(struct commitinfo *ci) err(1, "calloc"); if (git_patch_from_diff(&patch, ci->diff, i)) { git_patch_free(patch); + free(di); goto err; } di->patch = patch;