core: check for __mctp_alloc() failure in mctp_pktbuf_alloc()

Check for allocation failure in mctp_pktbuf_alloc(), as done
elsewhere in the code.

Change-Id: If3b6d84335d87f4d0ddef059910e63edab82a30e
Signed-off-by: Pedro Martelletto <martelletto@google.com>
Signed-off-by: Moritz Fischer <moritzf@google.com>
diff --git a/core.c b/core.c
index 51eda38..fcc9279 100644
--- a/core.c
+++ b/core.c
@@ -103,6 +103,9 @@
 	/* todo: pools */
 	buf = __mctp_alloc(sizeof(*buf) + size);
 
+	if (!buf)
+		return NULL;
+
 	buf->size = size;
 	buf->start = binding->pkt_header;
 	buf->end = buf->start + len;