Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit: release strbuf on error return in commit_tree_extended()
author
Rene Scharfe
<l.s.r@web.de>
Wed, 30 Aug 2017 17:49:38 +0000
(19:49 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Sep 2017 23:49:27 +0000
(08:49 +0900)
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
9c18b54
)
diff --git
a/commit.c
b/commit.c
index 8b28415939035e2b40153013e6f8805422094d84..51f969fcbc4a718c68ae2924e6cbd079e33d2222 100644
(file)
--- a/
commit.c
+++ b/
commit.c
@@
-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;
}