check u_malloc() result
diff --git a/src/lib/wsman-key-value.c b/src/lib/wsman-key-value.c
index 12e5d9e..cad23b2 100644
--- a/src/lib/wsman-key-value.c
+++ b/src/lib/wsman-key-value.c
@@ -43,8 +43,7 @@
 #include <ctype.h>
 #include <assert.h>
 
-#include "u/memory.h"
-#include "u/misc.h"
+#include "u/libu.h"
 #include "wsman-types.h"
 #include "wsman-key-value.h"
 #include "wsman-epr.h"
@@ -54,7 +53,10 @@
 {
   if (prealloc == NULL)
     prealloc = (key_value_t *)u_malloc(sizeof(key_value_t));
-
+  if (!prealloc) {
+    debug("u_malloc() failed in key_value_create\n");
+    return NULL;
+  }
   if (key) /* might be NULL if only value is stored */
     prealloc->key = u_strdup(key);
   else