From dfd255dd1a7c04ad24891db50e5d80d96f93fd4a Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Tue, 10 Jul 2007 00:47:23 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- connect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'connect.c') 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; -- cgit v1.2.3