From f198d550bc93256fea8301f11455a72b87c06d0d Mon Sep 17 00:00:00 2001 From: "fires.gc" Date: Wed, 17 Sep 2008 08:40:52 +0000 Subject: fix for small memory leaks git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@562 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/MemoryUtil.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Source/Core/Common/Src/MemoryUtil.cpp') diff --git a/Source/Core/Common/Src/MemoryUtil.cpp b/Source/Core/Common/Src/MemoryUtil.cpp index 23f8457dec..0099158872 100644 --- a/Source/Core/Common/Src/MemoryUtil.cpp +++ b/Source/Core/Common/Src/MemoryUtil.cpp @@ -102,7 +102,11 @@ void* AllocateMemoryPages(int size) void FreeMemoryPages(void* ptr, int size) { #ifdef _WIN32 - VirtualFree(ptr, 0, MEM_RELEASE); + if (ptr) + { + VirtualFree(ptr, 0, MEM_RELEASE); + ptr = NULL; + } #else munmap(ptr, size); #endif -- cgit v1.2.3