From 4e0ada9701a819193e25f58e196fc47f9ad8c606 Mon Sep 17 00:00:00 2001 From: Erik Kline Date: Tue, 30 Jun 2015 23:01:03 +0900 Subject: Properly initialize struct irec pointers after malloc() Failing to properly initialize struct irec pointers to NULL after malloc()ing structs that contain them makes subsequent comparison of said pointers to NULL unreliable, to say the least. Bug: 21411241 Change-Id: Id51c17a013250a5a80c867f7e074a70e0e3cc5e3 (cherry picked from commit f16178371856ff9b9d739e5b7122f1e82ee1d681) --- src/network.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network.c b/src/network.c index cb2001d..e24ec3a 100755 --- a/src/network.c +++ b/src/network.c @@ -309,6 +309,7 @@ static int create_ipv6_listener(struct listener **link, int port) l->tcpfd = tcpfd; l->tftpfd = -1; l->family = AF_INET6; + l->iface = NULL; l->next = NULL; *link = l; @@ -381,6 +382,7 @@ struct listener *create_wildcard_listeners(void) l->fd = fd; l->tcpfd = tcpfd; l->tftpfd = tftpfd; + l->iface = NULL; l->next = l6; return l; -- cgit v1.2.3