Index: slpd/slpd_process.c
===================================================================
--- slpd/slpd_process.c
+++ slpd/slpd_process.c
@@ -38,6 +38,7 @@
  * @ingroup    SlpdCode
  */
 
+#include "../libslp/slp.h"
 #include "slpd_process.h"
 #include "slpd_property.h"
 #include "slpd_database.h"
@@ -120,7 +121,7 @@
       if (result == 0)
       {
          /* TODO: out of memory, what should we do here! */
-         errorcode = SLP_ERROR_INTERNAL_ERROR;
+		  errorcode = SLP_MEMORY_ALLOC_FAILED;
          goto FINISHED;
       }
 
@@ -225,7 +226,7 @@
        */
       *sendbuf = SLPBufferRealloc(*sendbuf, 4096);
       if (*sendbuf == 0)
-         return SLP_ERROR_INTERNAL_ERROR;
+		  return SLP_MEMORY_ALLOC_FAILED;
 
       if (errorcode == 0)
       {
@@ -418,6 +419,8 @@
           */
          return errorcode;
       }
+	   if (errorcode != SLP_MEMORY_ALLOC_FAILED)
+		  result = *sendbuf;
       goto RESPOND;
    }
    if (SLPCompareString(message->body.srvrqst.srvtypelen, 
@@ -431,6 +434,8 @@
           */
          return errorcode;
       }
+	   if (errorcode != SLP_MEMORY_ALLOC_FAILED)
+		  result = *sendbuf;
       goto RESPOND;
    }
 
