Commit 78db0239 by Edward Thomson

squash some leaks

parent c5e07187
......@@ -1052,12 +1052,10 @@ static int get_terminal(git_reference **out, git_repository *repo, const char *r
error = 0;
} else {
error = get_terminal(out, repo, git_reference_symbolic_target(ref), nesting + 1);
if (error == GIT_ENOTFOUND) {
if (!*out) /* set by the error case in lookup above */
*out = ref;
} else {
if (error == GIT_ENOTFOUND && !*out)
*out = ref;
else
git_reference_free(ref);
}
}
return error;
......
......@@ -133,7 +133,9 @@ void git_repository_free(git_repository *repo)
for (i = 0; i < repo->reserved_names.size; i++)
git_buf_free(git_array_get(repo->reserved_names, i));
git_array_clear(repo->reserved_names);
git__free(repo->path_gitlink);
git__free(repo->path_repository);
git__free(repo->workdir);
git__free(repo->namespace);
......
......@@ -64,6 +64,7 @@ int buf_writestream_write(git_writestream *s, const char *buf, size_t len)
int buf_writestream_close(git_writestream *s)
{
GIT_UNUSED(s);
return 0;
}
......@@ -94,4 +95,5 @@ void test_filter_file__apply_stream(void)
cl_assert_equal_s("crlf\ncrlf\ncrlf\ncrlf\n", write_target.buf.ptr);
git_filter_list_free(fl);
write_target.base.free((struct git_writestream *)&write_target);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment