Skip to content

Commit 41ccbc0

Browse files
authored
Merge pull request libgit2#5783 from lhchavez/mwindow-coverity
mwindow: Fix a bug in the LRU window finding code
2 parents 50f5362 + 2f382ab commit 41ccbc0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mwindow.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ static int git_mwindow_find_lru_file_locked(git_mwindow_file **out)
312312
current_file, &mru_window, NULL, true, GIT_MWINDOW__MRU)) {
313313
continue;
314314
}
315-
if (!lru_window || lru_window->last_used > mru_window->last_used)
315+
if (!lru_window || lru_window->last_used > mru_window->last_used) {
316+
lru_window = mru_window;
316317
lru_file = current_file;
318+
}
317319
}
318320

319321
if (!lru_file) {

0 commit comments

Comments
 (0)