shithub: git9

Download patch

ref: 3f64088be2100710c039baa8ace39baf692c5d30
parent: e84f3bcce42660a4a188c1236cc7da5347663c52
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Dec 15 10:21:30 EST 2020

git/serve: fix uninitialized free

--- a/serve.c
+++ b/serve.c
@@ -32,10 +32,11 @@
 
 	ret = -1;
 	nrefs = 0;
-	if(resolveref(&head, "HEAD") != -1) {
+	refs = nil;
+	names = nil;
+	if(resolveref(&head, "HEAD") != -1)
 		if(fmtpkt(c, "%H HEAD", head) == -1)
 			goto error;
-	}
 
 	if((nrefs = listrefs(&refs, &names)) == -1)
 		sysfatal("listrefs: %r");