From 53bc79433414cb188e7bbb728085b2885f182221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 6 Nov 2008 11:18:01 +0000 Subject: [PATCH] Free buffer in error case. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28529 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/networkstatus/NetworkStatusView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;