diff options
author | Rene Scharfe <l.s.r@web.de> | 2017-08-30 19:49:38 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-07 01:49:27 +0200 |
commit | e505146dac276cc051eca199f9dc7ca88bef5f18 (patch) | |
tree | 817caed255da7c3bc213d2e72bb48843e5e3b3ef /commit.c | |
parent | clone: release strbuf after use in remove_junk() (diff) | |
download | git-e505146dac276cc051eca199f9dc7ca88bef5f18.tar.xz git-e505146dac276cc051eca199f9dc7ca88bef5f18.zip |
commit: release strbuf on error return in commit_tree_extended()
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1564,10 +1564,13 @@ int commit_tree_extended(const char *msg, size_t msg_len, if (encoding_is_utf8 && !verify_utf8(&buffer)) fprintf(stderr, _(commit_utf8_warn)); - if (sign_commit && do_sign_commit(&buffer, sign_commit)) - return -1; + if (sign_commit && do_sign_commit(&buffer, sign_commit)) { + result = -1; + goto out; + } result = write_sha1_file(buffer.buf, buffer.len, commit_type, ret); +out: strbuf_release(&buffer); return result; } |