]> git.proxmox.com Git - libgit2.git/commitdiff
reset: Fix a memory leak
authornulltoken <emeric.fermas@gmail.com>
Sun, 6 Jan 2013 14:26:54 +0000 (15:26 +0100)
committernulltoken <emeric.fermas@gmail.com>
Sun, 6 Jan 2013 15:22:28 +0000 (16:22 +0100)
src/reset.c

index f5daa8f555861046330d2d7596a1807f3151213c..307e6726003158dbf8eaba1256d8aba871b6df1f 100644 (file)
@@ -107,8 +107,7 @@ int git_reset(
        if (reset_type > GIT_RESET_SOFT) {
                /* reset index to the target content */
 
-               if ((error = git_repository_index(&index, repo)) < 0 ||
-                       (error = git_index_read_tree(index, tree)) < 0 ||
+               if ((error = git_index_read_tree(index, tree)) < 0 ||
                        (error = git_index_write(index)) < 0)
                        goto cleanup;