Skip to contentSkip to conversation

http: release strbuf on disabled alternates

PATCH In review Eric Wong 2 participants 2 messages Mar 4, 2017

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 http: release strbuf on disabled alternates

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")
---
 http-walker.c | 2 ++
 1 file changed, 2 insertions(+)
http-walker.c +2 -0
index b34b6ace7c..2c85316112 100644
@@ -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);
 				}
 			}
 		}
Signature · 1 line
EW
#1 lore raw
Quoted 2 lines · Eric Wong

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

Yep, this looks good.

-Peff