Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 4/7] remote.c: add command line option parser for --lockref

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:11

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));
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help