]> git.proxmox.com Git - libgit2.git/commitdiff
Clean up some memory leaks
authorEdward Thomson <ethomson@microsoft.com>
Mon, 13 Oct 2014 18:34:32 +0000 (14:34 -0400)
committerEdward Thomson <ethomson@microsoft.com>
Mon, 27 Oct 2014 02:27:44 +0000 (22:27 -0400)
src/remote.c
tests/index/cache.c

index 362c226c4e54b5cce0fae724b6b8bdc0732cde33..4b516420f59eda23f3d0286ab2aeefff172c5477 100644 (file)
@@ -1255,6 +1255,7 @@ static int opportunistic_updates(const git_remote *remote, git_vector *refs, con
 
                error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, true, sig, msg);
                git_buf_free(&refname);
+               git_reference_free(ref);
 
                if (error < 0)
                        return error;
index de5cd8308aea33e5c41172402f3a68956111ef08..3982bf18368fad03685ecc1ff6f206623911a286 100644 (file)
@@ -170,6 +170,8 @@ void test_index_cache__two_levels(void)
        tree_cache = git_tree_cache_get(index->tree, "subdir");
        cl_assert(tree_cache);
        cl_assert_equal_i(1, tree_cache->entry_count);
+
+       git_index_free(index);
 }
 
 void test_index_cache__read_tree_children(void)