]> git.meshlink.io Git - utcp/commitdiff
Fix check for return value of malloc().
authorGuus Sliepen <guus@meshlink.io>
Sun, 18 Oct 2015 11:43:53 +0000 (13:43 +0200)
committerGuus Sliepen <guus@sliepen.org>
Sun, 2 Jul 2017 10:01:52 +0000 (12:01 +0200)
utcp.c

diff --git a/utcp.c b/utcp.c
index 354cbe547637b0bdf0dc4709dee2205b23d0863e..ce056904169c6923baa95a0e5435626e5da75fd5 100644 (file)
--- 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;