Commit d58afb1725ee25bdb47f8d44d6002b1c4f969876

Nelson Elhage 2018-06-24T22:28:37

git_smart__connect: free symrefs on error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/transports/smart.c b/src/transports/smart.c
index e83a3c5..5527a5b 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -274,8 +274,10 @@ static int git_smart__connect(
 		return error;
 
 	/* Detect capabilities */
-	if (git_smart__detect_caps(first, &t->caps, &symrefs) < 0)
+	if (git_smart__detect_caps(first, &t->caps, &symrefs) < 0) {
+		free_symrefs(&symrefs);
 		return -1;
+	}
 
 	/* If the only ref in the list is capabilities^{} with OID_ZERO, remove it */
 	if (1 == t->refs.length && !strcmp(first->head.name, "capabilities^{}") &&