UPnP: remove unneeded vector in InitUPnP()

This commit is contained in:
Michael M 2017-08-07 11:34:08 -07:00
parent b5d070b0cf
commit 7ce9f1f984
1 changed files with 2 additions and 6 deletions

View File

@ -31,7 +31,6 @@ static bool InitUPnP()
static bool s_inited = false; static bool s_inited = false;
static bool s_error = false; static bool s_error = false;
std::vector<UPNPDev*> igds;
int upnperror = 0; int upnperror = 0;
// Don't init if already inited // Don't init if already inited
@ -64,12 +63,9 @@ static bool InitUPnP()
// Look for the IGD // Look for the IGD
for (UPNPDev* dev = devlist.get(); dev; dev = dev->pNext) for (UPNPDev* dev = devlist.get(); dev; dev = dev->pNext)
{ {
if (std::strstr(dev->st, "InternetGatewayDevice")) if (!std::strstr(dev->st, "InternetGatewayDevice"))
igds.push_back(dev); continue;
}
for (const UPNPDev* dev : igds)
{
int desc_xml_size = 0; int desc_xml_size = 0;
std::unique_ptr<char, decltype(&std::free)> desc_xml(nullptr, std::free); std::unique_ptr<char, decltype(&std::free)> desc_xml(nullptr, std::free);
int statusCode = 200; int statusCode = 200;