[PATCH 08/14] remote-curl: free "discovery" object
- From
Jeff King <peff@peff.net>
- Date
- Nov 10, 2011, 07:50 UTC
- Message-ID
- <20111110075008.GH27950@sigill.intra.peff.net>
- In-Reply-To
- <20111110074330.GA27925@sigill.intra.peff.net>
We cache the last-used "discovery" object, which contains the data we pulled from the remote about which refs it has, which saves us an HTTP round-trip when somebody does something like "list" followed by "fetch".
We don't bother free()ing it at the end of the program because it just contains memory which will be reclaimed by the OS. However, cleaning up explicitly will future-proof us against later changes which will add external storage (like temporary files).
Signed-off-by: Jeff King <peff@peff.net> --- remote-curl.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/remote-curl.c b/remote-curl.c index fb4d853..014d413 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -933,6 +933,7 @@ int main(int argc, const char **argv) strbuf_reset(&buf); } while (1); + free_discovery(last_discovery); http_cleanup(); return 0;
-- 1.7.7.2.7.g9f96f