Skip to contentSkip to conversation

Some cleanup in get_refs_via_curl()

PATCH In review Tay Ray Chuan 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 7/18 Some cleanup in get_refs_via_curl()

---
 transport.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
transport.c +1 -0
index 89d846e..b7c1c39 100644
@@ -519,6 +519,7 @@ static struct ref *get_refs_via_curl(struct transport *transport, int for_push)
 		free(ref);
 	}
 
+	free(refs_url);
 	return refs;
 }
 

--
1.6.3.1

#1 lore raw
Quoted 2 lines · Tay Ray Chuan

The same comment as 06/18 on attribution apllies.

Be specific when you can without going to too verbose. In this case, instead of wasting two meaningless words "Some cleanup", you can say:

Subject: transport.c::get_refs_via_curl(): do not leak refs_url

Quoted 17 lines
 transport.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
transport.c +1 -1
index 89d846e..b7c1c39 100644
@@ -519,6 +519,7 @@ static struct ref *get_refs_via_curl(struct transport *transport, int for_push)
 		free(ref);
 	}
 
+	free(refs_url);
 	return refs;
 }
 
--

1.6.3.1