Welcome to mirror list, hosted at ThFree Co, Russian Federation.

crashes.c « refs « tests-clar - github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e1b289ace2d3175b57a549ccb18fb4538f3b1157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "clar_libgit2.h"

void test_refs_crashes__double_free(void)
{
	git_repository *repo;
	git_reference *ref, *ref2;
	const char *REFNAME = "refs/heads/xxx";

	cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git")));
	cl_git_pass(git_reference_create_symbolic(&ref, repo, REFNAME, "refs/heads/master", 0));
	cl_git_pass(git_reference_lookup(&ref2, repo, REFNAME));
	cl_git_pass(git_reference_delete(ref));
	/* reference is gone from disk, so reloading it will fail */
	cl_git_fail(git_reference_reload(ref2));

	git_repository_free(repo);
}