summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win/inspircd_memory_functions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/win/inspircd_memory_functions.cpp b/win/inspircd_memory_functions.cpp
index 9dec63f67..4eeadfab1 100644
--- a/win/inspircd_memory_functions.cpp
+++ b/win/inspircd_memory_functions.cpp
@@ -40,7 +40,8 @@ void * ::operator new(size_t iSize)
void ::operator delete(void * ptr)
{
- HeapFree(GetProcessHeap(), 0, ptr);
+ if (ptr)
+ HeapFree(GetProcessHeap(), 0, ptr);
}
void * operator new[] (size_t iSize) {
@@ -53,5 +54,6 @@ void * operator new[] (size_t iSize) {
void operator delete[] (void* ptr)
{
- HeapFree(GetProcessHeap(), 0, ptr);
+ if (ptr)
+ HeapFree(GetProcessHeap(), 0, ptr);
}