John Keeping [off-list ref] writes:
On Tue, Jul 09, 2013 at 12:53:27PM -0700, Junio C Hamano wrote:
quoted
diff --git a/remote.c b/remote.c
index 81bc876..e9b423a 100644
--- a/remote.c
+++ b/remote.c
@@ -1938,3 +1938,62 @@ struct ref *get_stale_heads(struct refspec *refs, int ref_count, struct ref *fet
string_list_clear(&ref_names, 0);
return stale_refs;
}
+
+/*
+ * Lockref aka CAS
+ */
+void clear_cas_option(struct push_cas_option *cas)
+{
+ int i;
+
+ for (i = 0; i < cas->nr; i++)
+ free(cas->entry->refname);
Should this be
free(cas->entry[i]->refname);
?
Yes, more like "free(cas->entry[i].refname)".
Thanks for spotting.
quoted
+ free(cas->entry);
+ memset(cas, 0, sizeof(*cas));
+}