changeset 650:df11cb6a3665

- We don't need to test for NULL before free()
author Matt Johnston <matt@ucc.asn.au>
date Sun, 04 Dec 2011 05:23:43 +0800
parents 234cf769bcb3
children a48a1f6ab43e
files dbutil.c dbutil.h
diffstat 2 files changed, 1 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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();