From: Guus Sliepen Date: Sun, 18 Oct 2015 11:43:53 +0000 (+0200) Subject: Fix check for return value of malloc(). X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=f268b8518415a5cf896e1b3518c2a0141d1364d4;p=utcp Fix check for return value of malloc(). --- diff --git a/utcp.c b/utcp.c index 354cbe5..ce05690 100644 --- a/utcp.c +++ b/utcp.c @@ -365,7 +365,7 @@ static void ack(struct utcp_connection *c, bool sendatleastone) { } *pkt; pkt = malloc(sizeof pkt->hdr + c->utcp->mtu); - if(!pkt->data) + if(!pkt) return; pkt->hdr.src = c->src;