]> git.proxmox.com Git - libgit2.git/commitdiff
tests: index: do not re-allocate index
authorPatrick Steinhardt <ps@pks.im>
Mon, 29 Aug 2016 11:09:58 +0000 (13:09 +0200)
committerPatrick Steinhardt <ps@pks.im>
Mon, 29 Aug 2016 11:29:01 +0000 (13:29 +0200)
Plug a memory leak caused by re-allocating a `git_index`
structure which has already been allocated by the test suite's
initializer.

tests/index/collision.c

index ad5827e0b3d5df7ff5b8acc81c39f7efacbba179..41eb7bfdc02231f680d5ec9ee89ce2fe5df7a302 100644 (file)
@@ -79,8 +79,6 @@ void test_index_collision__add_with_highstage_2(void)
 {
        git_index_entry entry;
 
-       cl_git_pass(git_repository_index(&g_index, g_repo));
-
        memset(&entry, 0, sizeof(entry));
        entry.ctime.seconds = 12346789;
        entry.mtime.seconds = 12346789;