From 7ce9f1f984b4941dc953981ae0cdeab28f0a8efc Mon Sep 17 00:00:00 2001 From: Michael M Date: Mon, 7 Aug 2017 11:34:08 -0700 Subject: [PATCH] UPnP: remove unneeded vector in InitUPnP() --- Source/Core/Common/UPnP.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/Core/Common/UPnP.cpp b/Source/Core/Common/UPnP.cpp index 411beb45f0..767f49c418 100644 --- a/Source/Core/Common/UPnP.cpp +++ b/Source/Core/Common/UPnP.cpp @@ -31,7 +31,6 @@ static bool InitUPnP() static bool s_inited = false; static bool s_error = false; - std::vector igds; int upnperror = 0; // Don't init if already inited @@ -64,12 +63,9 @@ static bool InitUPnP() // Look for the IGD for (UPNPDev* dev = devlist.get(); dev; dev = dev->pNext) { - if (std::strstr(dev->st, "InternetGatewayDevice")) - igds.push_back(dev); - } + if (!std::strstr(dev->st, "InternetGatewayDevice")) + continue; - for (const UPNPDev* dev : igds) - { int desc_xml_size = 0; std::unique_ptr desc_xml(nullptr, std::free); int statusCode = 200;