summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2007-07-10 00:47:23 -0400
committerJunio C Hamano <gitster@pobox.com>2007-07-09 23:39:59 -0700
commitdfd255dd1a7c04ad24891db50e5d80d96f93fd4a (patch)
tree0a7640ebb74f4f2b60ccc1dbc7cc87070b777f04 /connect.c
parent54dadbdb29668fbd51effefd0a0c65d915f5422b (diff)
downloadgit-dfd255dd1a7c04ad24891db50e5d80d96f93fd4a.tar.gz
Add allocation and freeing functions for struct refs
Instead of open-coding allocation wherever it happens, have a function. Also, add a function to free a list of refs, which we currently never actually do. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/connect.c b/connect.c
index 65e79edc77..715cdc0223 100644
--- a/connect.c
+++ b/connect.c
@@ -72,7 +72,7 @@ struct ref **get_remote_heads(int in, struct ref **list,
continue;
if (nr_match && !path_match(name, nr_match, match))
continue;
- ref = xcalloc(1, sizeof(*ref) + len - 40);
+ ref = alloc_ref(len - 40);
hashcpy(ref->old_sha1, old_sha1);
memcpy(ref->name, buffer + 41, len - 40);
*list = ref;