summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Kline <ek@google.com>2015-06-30 23:01:03 +0900
committerErik Kline <ek@google.com>2015-06-30 23:01:03 +0900
commitf16178371856ff9b9d739e5b7122f1e82ee1d681 (patch)
tree9a147e056058adaeb710914da7ec8eee1b9fcf35
parentda2c6a7df19095aa2dbc5f722eac6c1bb85daaaa (diff)
downloadandroid_external_dnsmasq-f16178371856ff9b9d739e5b7122f1e82ee1d681.tar.gz
android_external_dnsmasq-f16178371856ff9b9d739e5b7122f1e82ee1d681.tar.bz2
android_external_dnsmasq-f16178371856ff9b9d739e5b7122f1e82ee1d681.zip
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
-rwxr-xr-xsrc/network.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c
index f2ccf34..c7431df 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;