Skip to content

Commit

Permalink
Updated to check for NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
schuchert committed Oct 8, 2011
1 parent ef0fb30 commit 636e2e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CommonMemory.h
Expand Up @@ -5,10 +5,12 @@
#ifdef CPPUTEST_USE_MEM_LEAK_DETECTION
#include <CppUTest/TestHarness_c.h>
#define acquire(s) cpputest_malloc_location((s), __FILE__, __LINE__)
#define release(s) cpputest_free_location((s), __FILE__, __LINE__)
#define release(s) if(s != NULL) cpputest_free_location((s), __FILE__, __LINE__)
#else
#include <memory.h>
#include <stddef.h>
#define acquire(s) malloc((s))
#define release(s) free((s))
#define release(s) if(s != NULL) free(s)
#endif

#include <stdlib.h>
Expand Down

0 comments on commit 636e2e9

Please sign in to comment.