From 3d72ada2828a96461a495ed0c8ea61c4e110328f Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 25 Apr 2021 16:55:04 -0700 Subject: [PATCH] Core: Fix memory leak in opening games from the library --- CHANGES | 1 + src/core/library.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index f1c377166..167d94581 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ 0.9.2: (Future) Other fixes: + - Core: Fix memory leak in opening games from the library - Qt: Fix infrequent deadlock when using sync to video 0.9.1: (2021-04-18) diff --git a/src/core/library.c b/src/core/library.c index eeb7794de..966fa132b 100644 --- a/src/core/library.c +++ b/src/core/library.c @@ -456,6 +456,11 @@ struct VFile* mLibraryOpenVFile(struct mLibrary* library, const struct mLibraryE break; } } + for (i = 0; i < mLibraryListingSize(&entries); ++i) { + struct mLibraryEntry* e = mLibraryListingGetPointer(&entries, i); + mLibraryEntryFree(e); + } + mLibraryListingDeinit(&entries); return vf; }