From: Jeff King Date: Fri, 22 Jul 2011 17:00:03 +0000 (-0600) Subject: streaming: free git_istream upon closing X-Git-Tag: v1.7.7-rc0~60^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/95dea6eb507109f64ab80f7fa2f73c39a0d14e7c?hp=95dea6eb507109f64ab80f7fa2f73c39a0d14e7c streaming: free git_istream upon closing Kirill Smelkov noticed that post-1.7.6 "git checkout" started leaking tons of memory. The streaming_write_entry function properly calls close_istream(), but that function did not actually free() the allocated git_istream struct. The git_istream struct is totally opaque to calling code, and must be heap-allocated by open_istream. Therefore it's not appropriate for callers to have to free it. This patch makes close_istream() into "close and de-allocate all associated resources". We could add a new "free_istream" call, but there's not much point in letting callers inspect the istream after close. And this patch's semantics make us match fopen/fclose, which is well-known and understood. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---