diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-11-28 21:08:29 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-11-28 21:08:29 +0100 |
| commit | 89886d0bbb7e4d3976a684b38151149bad152e39 (patch) | |
| tree | e5ed44631918cccc0c2562bac8bb12312384ae17 /src/index.c | |
| parent | a5123ea80b4a2a561863e69bf15a5d73243b3eb6 (diff) | |
| download | libgit2-89886d0bbb7e4d3976a684b38151149bad152e39.tar.gz | |
Plug a bunch of leaks
Diffstat (limited to 'src/index.c')
| -rw-r--r-- | src/index.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c index d01262b39..9f336ba0a 100644 --- a/src/index.c +++ b/src/index.c @@ -87,6 +87,8 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size) static int is_index_extended(git_index *index); static int write_index(git_index *index, git_filebuf *file); +static void index_entry_free(git_index_entry *entry); + static int index_srch(const void *key, const void *array_member) { const git_index_entry *entry = array_member; @@ -157,8 +159,17 @@ int git_index_open(git_index **index_out, const char *index_path) static void index_free(git_index *index) { + git_index_entry *e; + unsigned int i; + git_index_clear(index); + git_vector_foreach(&index->entries, i, e) { + index_entry_free(e); + } git_vector_free(&index->entries); + git_vector_foreach(&index->unmerged, i, e) { + index_entry_free(e); + } git_vector_free(&index->unmerged); git__free(index->index_file_path); |
