summaryrefslogtreecommitdiff
path: root/tree-walk.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-07-22 17:00:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-07-22 21:30:49 (GMT)
commit95dea6eb507109f64ab80f7fa2f73c39a0d14e7c (patch)
tree0945227c46afac0e556955396478d6ab00bd4844 /tree-walk.c
parent6b6cab3f9af2ab7010592e50bb343b990a6a7666 (diff)
downloadgit-95dea6eb507109f64ab80f7fa2f73c39a0d14e7c.zip
git-95dea6eb507109f64ab80f7fa2f73c39a0d14e7c.tar.gz
git-95dea6eb507109f64ab80f7fa2f73c39a0d14e7c.tar.bz2
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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.c')
0 files changed, 0 insertions, 0 deletions