Commit 87d98011 authored by Sven Strickroth's avatar Sven Strickroth

Fix possible memory leaks

Signed-off-by: Sven Strickroth's avatarSven Strickroth <email@cs-ware.de>
parent 8c893edf
......@@ -1547,7 +1547,10 @@ int CGit::GetBranchList(STRING_VECTOR &list,int *current,BRANCH_TYPE type)
{
const char * name = nullptr;
if (git_branch_name(&name, ref))
{
git_reference_free(ref);
continue;
}
CString branchname = CUnicodeUtils::GetUnicode(name);
if (branchType & GIT_BRANCH_REMOTE)
list.push_back(_T("remotes/") + branchname);
......
......@@ -173,6 +173,7 @@ int ParserFromRefLog(CString ref, std::vector<GitRev> &refloglist)
git_reflog *reflog;
if (git_reflog_read(&reflog, repo, refA) < 0)
{
git_repository_free(repo);
MessageBox(nullptr, CGit::GetLibGit2LastErr(_T("Could not read reflog.")), _T("TortoiseGit"), MB_ICONERROR);
return -1;
}
......
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