diff --git a/src/cpp/utils/IPFinder.cpp b/src/cpp/utils/IPFinder.cpp index 1d39214504..2611f66434 100644 --- a/src/cpp/utils/IPFinder.cpp +++ b/src/cpp/utils/IPFinder.cpp @@ -335,7 +335,7 @@ bool IPFinder::getAllMACAddress( IPFinder::getIPs(&ips); for (auto& ip : ips) { - struct ifreq ifr; + struct ifreq ifr = {}; strncpy(ifr.ifr_name, ip.dev.c_str(), sizeof(ifr.ifr_name) - 1); int fd = socket(PF_INET, SOCK_DGRAM, 0); if (fd == -1)