summaryrefslogtreecommitdiffhomepage
path: root/dbmalloc.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-03-02 00:02:06 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-03-02 00:02:06 +0800
commite612aec5d9f25a7334d9e2981f1aabf12b889b64 (patch)
tree211d3a37054da7b583544353018acb64441703c5 /dbmalloc.h
parent5bd0c0d25aa4d15f6b034c015ef8ecd501947127 (diff)
Attempt to fix m_free for libtomcrypt/libtommath
Diffstat (limited to 'dbmalloc.h')
-rw-r--r--dbmalloc.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/dbmalloc.h b/dbmalloc.h
index a5a13ad..d5e814e 100644
--- a/dbmalloc.h
+++ b/dbmalloc.h
@@ -1,7 +1,9 @@
#ifndef DBMALLOC_H_
#define DBMALLOC_H_
-#include "includes.h"
+#include "stdint.h"
+#include "stdlib.h"
+#include "options.h"
void * m_malloc(size_t size);
void * m_calloc(size_t nmemb, size_t size);
@@ -10,16 +12,16 @@ 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)
+#define m_free_direct free
#endif
+#define m_free(X) do {m_free_direct(X); (X) = NULL;} while (0)
+
#endif /* DBMALLOC_H_ */