OSDN Git Service

http: release strbuf on disabled alternates
authorEric Wong <e@80x24.org>
Sat, 4 Mar 2017 01:50:16 +0000 (01:50 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Mar 2017 18:52:57 +0000 (10:52 -0800)
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>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-walker.c

index 6396ceb..ab7d553 100644 (file)
@@ -319,6 +319,8 @@ static void process_alternates_response(void *callback_data)
                                        while (tail->next != NULL)
                                                tail = tail->next;
                                        tail->next = newalt;
+                               } else {
+                                       strbuf_release(&target);
                                }
                        }
                }