diff dbmalloc.h @ 1569:c42e8ff42bd1

Only use malloc wrapper if fuzzing
author Matt Johnston <matt@ucc.asn.au>
date Thu, 01 Mar 2018 23:46:24 +0800
parents 7209a6e30932
children d4efb7801fcd
line wrap: on
line diff
--- a/dbmalloc.h	Thu Mar 01 23:46:07 2018 +0800
+++ b/dbmalloc.h	Thu Mar 01 23:46:24 2018 +0800
@@ -7,10 +7,19 @@
 void * m_calloc(size_t nmemb, size_t size);
 void * m_strdup(const char * str);
 void * m_realloc(void* ptr, size_t size);
+
+#if DROPBEAR_TRACKING_MALLOC
 void m_free_direct(void* ptr);
 #define m_free(X) do {m_free_direct(X); (X) = NULL;} while (0)
-
 void m_malloc_set_epoch(unsigned int epoch);
 void m_malloc_free_epoch(unsigned int epoch, int dofree);
 
+#else
+/* plain wrapper */
+
+#define m_free(X) do {free(X); (X) = NULL;} while (0)
+
+#endif
+
+
 #endif /* DBMALLOC_H_ */