Unverified Commit 41ccbc04 by Edward Thomson Committed by GitHub

Merge pull request #5783 from lhchavez/mwindow-coverity

mwindow: Fix a bug in the LRU window finding code
parents 50f53622 2f382ab7
...@@ -312,9 +312,11 @@ static int git_mwindow_find_lru_file_locked(git_mwindow_file **out) ...@@ -312,9 +312,11 @@ static int git_mwindow_find_lru_file_locked(git_mwindow_file **out)
current_file, &mru_window, NULL, true, GIT_MWINDOW__MRU)) { current_file, &mru_window, NULL, true, GIT_MWINDOW__MRU)) {
continue; continue;
} }
if (!lru_window || lru_window->last_used > mru_window->last_used) if (!lru_window || lru_window->last_used > mru_window->last_used) {
lru_window = mru_window;
lru_file = current_file; lru_file = current_file;
} }
}
if (!lru_file) { if (!lru_file) {
git_error_set(GIT_ERROR_OS, "failed to close memory window file; couldn't find LRU"); git_error_set(GIT_ERROR_OS, "failed to close memory window file; couldn't find LRU");
......
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