From 50434b587371a9c9528ecd52962faa1deef48812 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 1 Aug 2015 15:51:34 +0200 Subject: [PATCH] LogDlg: When filtering only for paths log entries might contain invalid data When filtering only for paths SafeGetSimpleList is called before CheckAndParser. SafeGetSimpleList requests its own commit struct from libgit, however, the data is shared with m_GitCommit. So, only free the commit if its not shared with m_GitCommit. Signed-off-by: Sven Strickroth --- src/Git/GitRevLoglist.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Git/GitRevLoglist.cpp b/src/Git/GitRevLoglist.cpp index 59ad147f7..4ef031124 100644 --- a/src/Git/GitRevLoglist.cpp +++ b/src/Git/GitRevLoglist.cpp @@ -177,7 +177,8 @@ int GitRevLoglist::SafeGetSimpleList(CGit* git) InterlockedExchange(&m_IsUpdateing, FALSE); InterlockedExchange(&m_IsSimpleListReady, TRUE); - git_free_commit(&commit); + if (m_GitCommit.m_pGitCommit != commit.m_pGitCommit) + git_free_commit(&commit); return 0; } @@ -370,7 +371,8 @@ int GitRevLoglist::SafeFetchFullInfo(CGit* git) InterlockedExchange(&m_IsUpdateing, FALSE); InterlockedExchange(&m_IsFull, TRUE); - git_free_commit(&commit); + if (m_GitCommit.m_pGitCommit != commit.m_pGitCommit) + git_free_commit(&commit); return 0; } -- 2.11.4.GIT