summaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-28 11:30:41 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-28 11:30:41 -0700
commitad524f834a9acaaaceeb846d00ea609f79333a3d (patch)
tree2b6a49037e48602c34dea27d19e0668ed8c35724 /sha1_name.c
parent919eb8acea61fc461e69e2383e6290b4c3991c96 (diff)
parent31bb6d37f992128eca3707d4f58ec61425742e81 (diff)
downloadgit-ad524f834a9acaaaceeb846d00ea609f79333a3d.tar.gz
Merge branch 'jk/misc-fixes-maint'
* jk/misc-fixes-maint: apply: avoid possible bogus pointer fix memory leak parsing core.commentchar transport: fix leaks in refs_from_alternate_cb free ref string returned by dwim_ref receive-pack: don't copy "dir" parameter
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 6ccd3a53f8..63ee66fedd 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -540,8 +540,10 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
char *tmp = xstrndup(str + at + 2, reflog_len);
at_time = approxidate_careful(tmp, &errors);
free(tmp);
- if (errors)
+ if (errors) {
+ free(real_ref);
return -1;
+ }
}
if (read_ref_at(real_ref, at_time, nth, sha1, NULL,
&co_time, &co_tz, &co_cnt)) {