# HG changeset patch # User Matt Johnston # Date 1322947423 -28800 # Node ID df11cb6a366516d18183b5e0e80a86f2a68a7dc9 # Parent 234cf769bcb3352e466ed84d7975a9233e98ef65 - We don't need to test for NULL before free() diff -r 234cf769bcb3 -r df11cb6a3665 dbutil.c --- a/dbutil.c Fri Feb 10 19:09:52 2012 +0800 +++ b/dbutil.c Sun Dec 04 05:23:43 2011 +0800 @@ -800,12 +800,6 @@ return ret; } -void __m_free(void* ptr) { - if (ptr != NULL) { - free(ptr); - } -} - void * m_realloc(void* ptr, size_t size) { void *ret; diff -r 234cf769bcb3 -r df11cb6a3665 dbutil.h --- a/dbutil.h Fri Feb 10 19:09:52 2012 +0800 +++ b/dbutil.h Sun Dec 04 05:23:43 2011 +0800 @@ -83,8 +83,7 @@ void * m_malloc(size_t size); void * m_strdup(const char * str); void * m_realloc(void* ptr, size_t size); -#define m_free(X) __m_free(X); (X) = NULL; -void __m_free(void* ptr); +#define m_free(X) free(X); (X) = NULL; void m_burn(void* data, unsigned int len); void setnonblocking(int fd); void disallow_core();