Eighth batch for 2.7
[gitweb.git] / remote-curl.c
index 71fbbb694fc78471343f568a5e93b8013a7bb9cb..cc7a8a66faa96ba9bc8ae82e72d0202c0a802ba1 100644 (file)
@@ -168,10 +168,7 @@ static struct ref *parse_info_refs(struct discovery *heads)
                                    url.buf);
                        data[i] = 0;
                        ref_name = mid + 1;
-                       ref = xmalloc(sizeof(struct ref) +
-                                     strlen(ref_name) + 1);
-                       memset(ref, 0, sizeof(struct ref));
-                       strcpy(ref->name, ref_name);
+                       ref = alloc_ref(ref_name);
                        get_sha1_hex(start, ref->old_sha1);
                        if (!refs)
                                refs = ref;