diff --git a/src/apps/networkstatus/NetworkStatusView.cpp b/src/apps/networkstatus/NetworkStatusView.cpp index a8c1e6bc2c..1d68cda865 100644 --- a/src/apps/networkstatus/NetworkStatusView.cpp +++ b/src/apps/networkstatus/NetworkStatusView.cpp @@ -447,8 +447,10 @@ NetworkStatusView::_Update(bool force) config.ifc_len = count * sizeof(struct ifreq); config.ifc_buf = buffer; - if (ioctl(fSocket, SIOCGIFCONF, &config, sizeof(struct ifconf)) < 0) + if (ioctl(fSocket, SIOCGIFCONF, &config, sizeof(struct ifconf)) < 0) { + free(buffer); return; + } ifreq *interface = (ifreq *)buffer;