# [PATCH] http: release strbuf on disabled alternates

2 messages from 2017-03-04 to 2017-03-04. Participants: Eric Wong, Jeff King.
Thread: https://gitlist.dev/t/45289

## Eric Wong, 2017-03-04 01:50

Subject: [PATCH] http: release strbuf on disabled alternates
Message-ID: <20170304015016.GA25408@starla>
URL: https://gitlist.dev/e/20170304015016.GA25408%40starla

```
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(+)

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, 2017-03-04 03:42

Subject: Re: [PATCH] http: release strbuf on disabled alternates
Message-ID: <20170304034226.uz5pzu5nl2zmisjt@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20170304034226.uz5pzu5nl2zmisjt%40sigill.intra.peff.net
In-Reply-To: <20170304015016.GA25408@starla>

```
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

```
