From: Jo-Philipp Wich Date: Thu, 13 Sep 2012 06:56:14 +0000 (+0300) Subject: interface-ip.c: fix possible null pointer access if calloc() fails X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=commitdiff_plain;h=3e3bc6037848f1d86481e826899c515341c6159d interface-ip.c: fix possible null pointer access if calloc() fails --- diff --git a/interface-ip.c b/interface-ip.c index 0610ffd..d5488ef 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -430,6 +430,9 @@ interface_add_dns_server(struct interface_ip_settings *ip, const char *str) struct dns_server *s; s = calloc(1, sizeof(*s)); + if (!s) + return; + s->af = AF_INET; if (inet_pton(s->af, str, &s->addr.in)) goto add;