summaryrefslogtreecommitdiff
path: root/transport.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 /transport.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 'transport.c')
-rw-r--r--transport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/transport.c b/transport.c
index 80ed1262c2..662421bb5e 100644
--- a/transport.c
+++ b/transport.c
@@ -1357,11 +1357,11 @@ static int refs_from_alternate_cb(struct alternate_object_database *e,
while (other[len-1] == '/')
other[--len] = '\0';
if (len < 8 || memcmp(other + len - 8, "/objects", 8))
- return 0;
+ goto out;
/* Is this a git repository with refs? */
memcpy(other + len - 8, "/refs", 6);
if (!is_directory(other))
- return 0;
+ goto out;
other[len - 8] = '\0';
remote = remote_get(other);
transport = transport_get(remote, other);
@@ -1370,6 +1370,7 @@ static int refs_from_alternate_cb(struct alternate_object_database *e,
extra = extra->next)
cb->fn(extra, cb->data);
transport_disconnect(transport);
+out:
free(other);
return 0;
}