| 705 | } |
| 706 | |
| 707 | char* MemoryLeakDetector::reallocMemory(TestMemoryAllocator* allocator, char* memory, size_t size, const char* file, size_t line, bool allocatNodesSeperately) |
| 708 | { |
| 709 | #ifdef CPPUTEST_DISABLE_MEM_CORRUPTION_CHECK |
| 710 | allocatNodesSeperately = true; |
| 711 | #endif |
| 712 | if (memory) { |
| 713 | MemoryLeakDetectorNode* node = memoryTable_.removeNode(memory); |
| 714 | if (node == NULLPTR) { |
| 715 | outputBuffer_.reportDeallocateNonAllocatedMemoryFailure(file, line, allocator, reporter_); |
| 716 | return NULLPTR; |
| 717 | } |
| 718 | checkForCorruption(node, file, line, allocator, allocatNodesSeperately); |
| 719 | } |
| 720 | return reallocateMemoryAndLeakInformation(allocator, memory, size, file, line, allocatNodesSeperately); |
| 721 | } |
| 722 | |
| 723 | void MemoryLeakDetector::ConstructMemoryLeakReport(MemLeakPeriod period) |
| 724 | { |