diff --git a/libs/libc/netdb/lib_dnsforeach.c b/libs/libc/netdb/lib_dnsforeach.c index ec39eea2f4f..36e874a0b84 100644 --- a/libs/libc/netdb/lib_dnsforeach.c +++ b/libs/libc/netdb/lib_dnsforeach.c @@ -178,6 +178,7 @@ int dns_foreach_nameserver(dns_callback_t callback, FAR void *arg) } #endif /* CONFIG_NETDB_RESOLVCONF_NONSTDPORT */ + memset(&u, 0, sizeof(u)); #ifdef CONFIG_NET_IPv4 /* Try to convert the IPv4 address */