author | Jonathan Nieder <jrnieder@gmail.com> | |
Mon, 4 Oct 2010 04:34:27 +0000 (23:34 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Oct 2010 17:46:05 +0000 (10:46 -0700) | ||
commit | 9173912be36c4f967f42f176be767fc5ba3c4077 | |
tree | 013bd62b59f7b4ce95a00f8d7424a5d47ceefde3 | tree | snapshot |
parent | 95ae69b95ba595d884d31a5cee92a823ec0c705f | commit | diff |
init: plug tiny one-time memory leak
The buffer used to construct paths like ".git/objects/info" and
".git/objects/pack" is allocated on the heap and never freed.
So free it. While at it, factor out the relevant code into its own
function and rename the sha1_dir variable to object_directory (to
match the change in everyday usage after the renaming of
SHA1_FILE_DIRECTORY in v0.99~603^2~7, 2005).
Noticed by valgrind while setting up tests (in test-lib).
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The buffer used to construct paths like ".git/objects/info" and
".git/objects/pack" is allocated on the heap and never freed.
So free it. While at it, factor out the relevant code into its own
function and rename the sha1_dir variable to object_directory (to
match the change in everyday usage after the renaming of
SHA1_FILE_DIRECTORY in v0.99~603^2~7, 2005).
Noticed by valgrind while setting up tests (in test-lib).
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/init-db.c | diff | blob | history |