]> git.armaanb.net Git - stagit.git/commitdiff
fix potential leak, found by clang-analyzer
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 12 Mar 2017 20:30:43 +0000 (21:30 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 12 Mar 2017 20:30:43 +0000 (21:30 +0100)
stagit.c

index 835f6f3efb0f365b17f913de31a84110d781401d..06b6698d67fef3eba3252951a867e32b67fdd7b8 100644 (file)
--- 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;