diff options
author | Russell Belfer <rb@github.com> | 2013-06-01 01:09:58 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-01 01:09:58 +0400 |
commit | f658dc433cae351e72b1c8b245724eafb43f5844 (patch) | |
tree | 025948ea3b6a30c41b44d86fe4655fbeda3d578c /src/index.c | |
parent | 17ef7dbce4e4eaa08ed7007b6d67f375759846a8 (diff) |
Zero memory for major objects before freeing
By zeroing out the memory when we free larger objects (i.e. those
that serve as collections of other data, such as repos, odb, refdb),
I'm hoping that it will be easier for libgit2 bindings to find
errors in their object management code.
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c index 45ce2f3d6..abc9495bd 100644 --- a/src/index.c +++ b/src/index.c @@ -348,6 +348,8 @@ static void index_free(git_index *index) git_vector_free(&index->reuc); git__free(index->index_file_path); + + memset(index, 0, sizeof(*index)); git__free(index); } |