summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Kline <ek@google.com>2015-06-30 23:01:03 +0900
committerAbhishek Arya <aarya@google.com>2015-08-15 04:12:42 +0000
commit4e0ada9701a819193e25f58e196fc47f9ad8c606 (patch)
tree40852b5d7204aea2f281dad13aa5cabfda1d615f
parent41d356427a632f5336384bfa45c8420ffc274f66 (diff)
downloadandroid_external_dnsmasq-4e0ada9701a819193e25f58e196fc47f9ad8c606.tar.gz
android_external_dnsmasq-4e0ada9701a819193e25f58e196fc47f9ad8c606.tar.bz2
android_external_dnsmasq-4e0ada9701a819193e25f58e196fc47f9ad8c606.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 (cherry picked from commit f16178371856ff9b9d739e5b7122f1e82ee1d681)
-rwxr-xr-xsrc/network.c2
1 files changed, 2 insertions, 0 deletions
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;