ok?
Index: amd/xutil.c =================================================================== RCS file: /cvs/src/usr.sbin/amd/amd/xutil.c,v retrieving revision 1.17 diff -u -p -r1.17 xutil.c --- amd/xutil.c 26 Oct 2014 02:58:43 -0000 1.17 +++ amd/xutil.c 10 Dec 2015 20:04:43 -0000 @@ -84,13 +84,9 @@ xmalloc(size_t len) int retries = 600; do { - p = malloc(len); - if (p) { -#if defined(DEBUG) && defined(DEBUG_MEM) - Debug(D_MEM) plog(XLOG_DEBUG, "Allocated size %zu; block %#x", len, p); -#endif /* defined(DEBUG) && defined(DEBUG_MEM) */ + if ((p = malloc(len)) != NULL) return p; - } + if (retries > 0) { plog(XLOG_ERROR, "Retrying memory allocation"); sleep(1); @@ -103,10 +99,6 @@ xmalloc(size_t len) void * xreallocarray(void *ptr, size_t nmemb, size_t size) { -#if defined(DEBUG) && defined(DEBUG_MEM) - Debug(D_MEM) plog(XLOG_DEBUG, "Reallocated nmemb %zu of size %zu; block %#x", nmemb, size, ptr); -#endif /* defined(DEBUG) && defined(DEBUG_MEM) */ - ptr = reallocarray(ptr, nmemb, size); if (ptr == NULL) @@ -114,14 +106,6 @@ xreallocarray(void *ptr, size_t nmemb, s return (ptr); } -#if defined(DEBUG) && defined(DEBUG_MEM) -xfree(char *f, int l, void *p) -{ - Debug(D_MEM) plog(XLOG_DEBUG, "Free in %s:%d: block %#x", f, l, p); -#undef free - free(p); -} -#endif /* defined(DEBUG) && defined(DEBUG_MEM) */ #ifdef DEBUG_MEM static int mem_bytes; static int orig_mem_bytes; Index: amq/amq.c =================================================================== RCS file: /cvs/src/usr.sbin/amd/amq/amq.c,v retrieving revision 1.18 diff -u -p -r1.18 amq.c --- amq/amq.c 21 Jan 2015 09:50:25 -0000 1.18 +++ amq/amq.c 10 Dec 2015 20:04:44 -0000 @@ -565,11 +565,3 @@ privsock(int ty) } return sock; } - -#ifdef DEBUG -void -xfree(char *f, char *l, void *p) -{ - free(p); -} -#endif /* DEBUG */ Index: include/config.h =================================================================== RCS file: /cvs/src/usr.sbin/amd/include/config.h,v retrieving revision 1.11 diff -u -p -r1.11 config.h --- include/config.h 26 Oct 2014 02:32:51 -0000 1.11 +++ include/config.h 10 Dec 2015 20:04:44 -0000 @@ -72,10 +72,6 @@ extern int orig_umask; /* umask() on st #ifdef DEBUG #define D_ALL (~0) -#ifdef DEBUG_MEM -#define free(x) xfree(__FILE__,__LINE__,x) -#endif /* DEBUG_MEM */ - #define Debug(x) if (!(debug_flags & (x))) ; else #define dlog Debug(D_FULL) dplog #endif /* DEBUG */