threads / patch / 45289

patchhttp: release strbuf on disabled alternates

Subject: [PATCH] http: release strbuf on disabled alternates

## tl;dr

2 messages between Mar 4, 2017 and Mar 4, 2017. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Eric Wong· Mar 4, 2017, 01:50 UTC · lore

This likely has no real-world impact on memory usage, but it is cleaner for future readers.

Fixes: abcbdc03895f ("http: respect protocol.*.allow=user for http-alternates")
Signed-off-by: Eric Wong <e@80x24.org>
---
 http-walker.c | 2 ++
 1 file changed, 2 insertions(+)
Show changes to http-walker.c +2 −0
diff --git a/http-walker.c b/http-walker.c
index b34b6ace7c..2c85316112 100644
--- a/http-walker.c
+++ b/http-walker.c
@@ -314,6 +314,8 @@ static void process_alternates_response(void *callback_data)
 					while (tail->next != NULL)
 						tail = tail->next;
 					tail->next = newalt;
+				} else {
+					strbuf_release(&target);
 				}
 			}
 		}
-- 
EW
Jeff King· Mar 4, 2017, 03:42 UTC · re: Eric Wong · lore

Re: [PATCH] http: release strbuf on disabled alternates

On Sat, Mar 04, 2017 at 01:50:16AM +0000, Eric Wong wrote:
> This likely has no real-world impact on memory usage,
> but it is cleaner for future readers.
Yep, this looks good.
-Peff

← back to recent threads