Add a function free_ref_entry(). This function will become nontrivial
when ref_entry (soon) becomes polymorphic.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
return ref;
}
+static void free_ref_entry(struct ref_entry *entry)
+{
+ free(entry);
+}
+
/* Add a ref_entry to the end of the ref_array (unsorted). */
static void add_ref(struct ref_array *refs, struct ref_entry *ref)
{
{
int i;
for (i = 0; i < array->nr; i++)
- free(array->refs[i]);
+ free_ref_entry(array->refs[i]);
free(array->refs);
array->sorted = array->nr = array->alloc = 0;
array->refs = NULL;
i = 0;
for (j = 1; j < array->nr; j++) {
if (is_dup_ref(array->refs[i], array->refs[j])) {
- free(array->refs[j]);
+ free_ref_entry(array->refs[j]);
continue;
}
array->refs[++i] = array->refs[j];