From 0f6bdc7c16dd788bb6f40006d6b0676099c81ae2 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Tue, 5 Mar 2013 00:30:25 +0100 Subject: [PATCH] Fixed potential resource leak of library handle (found by Coverity, CID 989315) --- MemoryModule.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MemoryModule.c b/MemoryModule.c index 344a6bd..8541060 100644 --- a/MemoryModule.c +++ b/MemoryModule.c @@ -257,6 +257,7 @@ BuildImportTable(PMEMORYMODULE module) module->modules = (HMODULE *)realloc(module->modules, (module->numModules+1)*(sizeof(HMODULE))); if (module->modules == NULL) { + FreeLibrary(handle); result = 0; break; } @@ -284,6 +285,7 @@ BuildImportTable(PMEMORYMODULE module) } if (!result) { + FreeLibrary(handle); break; } }