Index: /trunk/src/VBox/Devices/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Devices/Makefile.kmk	(revision 15790)
+++ /trunk/src/VBox/Devices/Makefile.kmk	(revision 15791)
@@ -612,5 +612,5 @@
   $(file)_DEFS += \
       $(if $(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC), VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) \
-      $(if $(VBOX_WITH_SLIRP_MEMORY_CHECK),VBOX_WITH_SLIRP_MEMORY_CHECK,) \
+      $(if $(VBOX_WITH_SLIRP_MEMORY_CHECK),RTMEM_WRAP_TO_EF_APIS,) \
       $(if $(VBOX_WITH_DEBUG_NAT_SOCKETS),VBOX_WITH_DEBUG_NAT_SOCKETS,)
  ifeq ($(KBUILD_TARGET),win)
Index: /trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/ip_icmp.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/ip_icmp.c	(revision 15791)
@@ -140,5 +140,5 @@
 # endif /* VBOX_WITH_SIMPLIFIED_SLIRP_SYNC */
     pData->szIcmpBuffer = sizeof(ICMP_ECHO_REPLY) * 10;
-    pData->pvIcmpBuffer = malloc(pData->szIcmpBuffer);
+    pData->pvIcmpBuffer = RTMemAlloc(pData->szIcmpBuffer);
 #endif /* RT_OS_WINDOWS */
     LIST_INIT(&pData->icmp_msg_head);
@@ -249,5 +249,5 @@
     if (found == 1 && icm == NULL)
     {
-        icm = malloc(sizeof(struct icmp_msg));
+        icm = RTMemAlloc(sizeof(struct icmp_msg));
         icm->im_m = so->so_m;
         icm->im_so = so;
@@ -273,5 +273,5 @@
     ip = mtod(m, struct ip *);
     Assert(ip->ip_p == IPPROTO_ICMP);
-    icm = malloc(sizeof(struct icmp_msg));
+    icm = RTMemAlloc(sizeof(struct icmp_msg));
     icm->im_m = m;
     LIST_INSERT_HEAD(&pData->icmp_msg_head, icm, im_list);
Index: /trunk/src/VBox/Devices/Network/slirp/ip_input.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/ip_input.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/ip_input.c	(revision 15791)
@@ -308,5 +308,5 @@
     if (fp == NULL)
     {
-        fp = malloc(sizeof(struct ipq_t));
+        fp = RTMemAlloc(sizeof(struct ipq_t));
         if (fp == NULL)
             goto dropfrag;
Index: /trunk/src/VBox/Devices/Network/slirp/mbuf.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/mbuf.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/mbuf.c	(revision 15791)
@@ -57,5 +57,5 @@
     if (m_freelist.m_next == &m_freelist)
     {
-        m = (struct mbuf *)malloc(msize);
+        m = (struct mbuf *)RTMemAlloc(msize);
         if (m == NULL)
             goto end_error;
@@ -103,5 +103,5 @@
         /* If it's M_EXT, free() it */
         if (m->m_flags & M_EXT)
-            free(m->m_ext);
+            RTMemFree(m->m_ext);
 
         /*
@@ -110,5 +110,5 @@
         if (m->m_flags & M_DOFREE)
         {
-            free(m);
+            RTMemFree(m);
             mbuf_alloced--;
         }
@@ -155,5 +155,5 @@
     {
         datasize = m->m_data - m->m_ext;
-        m->m_ext = (char *)realloc(m->m_ext, size);
+        m->m_ext = (char *)RTMemRealloc(m->m_ext, size);
 #if 0
         if (m->m_ext == NULL)
@@ -166,5 +166,5 @@
         char *dat;
         datasize = m->m_data - m->m_dat;
-        dat = (char *)malloc(size);
+        dat = (char *)RTMemAlloc(size);
 #if 0
         if (dat == NULL)
Index: /trunk/src/VBox/Devices/Network/slirp/misc.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/misc.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/misc.c	(revision 15791)
@@ -70,9 +70,9 @@
 
     tmp_ptr = *ex_ptr;
-    *ex_ptr = (struct ex_list *)malloc(sizeof(struct ex_list));
+    *ex_ptr = (struct ex_list *)RTMemAlloc(sizeof(struct ex_list));
     (*ex_ptr)->ex_fport = port;
     (*ex_ptr)->ex_addr = addr;
     (*ex_ptr)->ex_pty = do_pty;
-    (*ex_ptr)->ex_exec = strdup(exec);
+    (*ex_ptr)->ex_exec = RTStrDup(exec);
     (*ex_ptr)->ex_next = tmp_ptr;
     return 0;
Index: /trunk/src/VBox/Devices/Network/slirp/sbuf.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/sbuf.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/sbuf.c	(revision 15791)
@@ -19,5 +19,5 @@
 sbfree(struct sbuf *sb)
 {
-    free(sb->sb_data);
+    RTMemFree(sb->sb_data);
 }
 
@@ -46,5 +46,7 @@
         if (sb->sb_datalen != size)
         {
-            sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)realloc(sb->sb_data, size);
+            sb->sb_wptr =
+            sb->sb_rptr =
+            sb->sb_data = (char *)RTMemRealloc(sb->sb_data, size);
             sb->sb_cc = 0;
             if (sb->sb_wptr)
@@ -56,5 +58,5 @@
     else
     {
-        sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)malloc(size);
+        sb->sb_wptr = sb->sb_rptr = sb->sb_data = (char *)RTMemAlloc(size);
         sb->sb_cc = 0;
         if (sb->sb_wptr)
Index: /trunk/src/VBox/Devices/Network/slirp/slirp.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/slirp.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/slirp.c	(revision 15791)
@@ -337,5 +337,5 @@
 {
     int fNATfailed = 0;
-    PNATState pData = malloc(sizeof(NATState));
+    PNATState pData = RTMemAlloc(sizeof(NATState));
     *ppData = pData;
     if (!pData)
@@ -1070,5 +1070,5 @@
 {
 #ifdef VBOX_WITH_SIMPLIFIED_SLIRP_SYNC
-    uint8_t *buf = malloc(1600); /* XXX:temporal solution */
+    uint8_t *buf = RTMemAlloc(1600); /* XXX:temporal solution */
     struct ethhdr *eh = (struct ethhdr *)buf;
 
Index: /trunk/src/VBox/Devices/Network/slirp/slirp.h
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/slirp.h	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/slirp.h	(revision 15791)
@@ -28,7 +28,4 @@
 #define LOG_GROUP LOG_GROUP_DRV_NAT
 #include <VBox/log.h>
-#ifdef VBOX_WITH_SLIRP_MEMORY_CHECK
-# define RTMEM_WRAP_TO_EF_APIS
-#endif /* VBOX_WITH_SLIRP_MEMORY_CHECK */
 #include <iprt/mem.h>
 #ifdef RT_OS_WINDOWS
@@ -41,7 +38,12 @@
 #include <VBox/types.h>
 
-#define malloc(a)       RTMemAlloc(a)
-#define free(a)         RTMemFree(a)
-#define realloc(a,b)    RTMemRealloc(a, b)
+#undef malloc
+#define malloc          dont_use_malloc
+#undef free
+#define free(a)         dont_use_free
+#undef realloc
+#define realloc(a,b)    dont_use_realloc
+#undef strdup
+#define strdup(a)       dont_use_strdup
 
 #include "slirp_config.h"
@@ -168,15 +170,4 @@
 #ifdef GETTIMEOFDAY_ONE_ARG
 # define gettimeofday(x, y) gettimeofday(x)
-#endif
-
-/* Systems lacking strdup() definition in <string.h>. */
-#if defined(ultrix)
-char *strdup _P((const char *));
-#endif
-
-/* Systems lacking malloc() definition in <stdlib.h>. */
-#if defined(ultrix) || defined(hcx)
-void *malloc _P((size_t arg));
-void free _P((void *ptr));
 #endif
 
Index: /trunk/src/VBox/Devices/Network/slirp/slirp_config.h
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/slirp_config.h	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/slirp_config.h	(revision 15791)
@@ -52,7 +52,4 @@
  */
 
-/* Ignore this */
-#undef DUMMY_PPP
-
 #ifdef _MSC_VER
 #undef HAVE_UNISTD_H
Index: /trunk/src/VBox/Devices/Network/slirp/socket.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/socket.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/socket.c	(revision 15791)
@@ -60,5 +60,5 @@
     struct socket *so;
 
-    so = (struct socket *)malloc(sizeof(struct socket));
+    so = (struct socket *)RTMemAlloc(sizeof(struct socket));
     if(so)
     {
Index: /trunk/src/VBox/Devices/Network/slirp/tcp_input.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/tcp_input.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/tcp_input.c	(revision 15791)
@@ -115,5 +115,5 @@
      * just drop the pkt.
      */
-    te = malloc(sizeof(struct tseg_qent));
+    te = RTMemAlloc(sizeof(struct tseg_qent));
     if (te == NULL)
     {
Index: /trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/tcp_subr.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/tcp_subr.c	(revision 15791)
@@ -186,5 +186,5 @@
     register struct tcpcb *tp;
 
-    tp = (struct tcpcb *)malloc(sizeof(*tp));
+    tp = (struct tcpcb *)RTMemAlloc(sizeof(*tp));
     if (tp == NULL)
         return ((struct tcpcb *)0);
Index: /trunk/src/VBox/Devices/Network/slirp/udp.c
===================================================================
--- /trunk/src/VBox/Devices/Network/slirp/udp.c	(revision 15790)
+++ /trunk/src/VBox/Devices/Network/slirp/udp.c	(revision 15791)
@@ -564,5 +564,5 @@
                 {
                     /* no entry for so, create new */
-                    req = (struct talk_request *)malloc(sizeof(struct talk_request));
+                    req = (struct talk_request *)RTMemAlloc(sizeof(struct talk_request));
                     req->udp_so = so;
                     req->tcp_so = solisten(0,
