core: handle memory allocation failures in mctp init

This just handles __mctp_alloc failures in libmctp.

Signed-off-by: Sumanth Bhat <sumanth.bhat@linux.intel.com>
Change-Id: I0b5beaf2b981a56133bd6caaf269e75e28cefba7
diff --git a/core.c b/core.c
index 1b7ee39..0be8c69 100644
--- a/core.c
+++ b/core.c
@@ -246,6 +246,10 @@
 	struct mctp *mctp;
 
 	mctp = __mctp_alloc(sizeof(*mctp));
+
+	if(!mctp)
+		return NULL;
+
 	memset(mctp, 0, sizeof(*mctp));
 	mctp->max_message_size = MCTP_MAX_MESSAGE_SIZE;