UPnP: remove unneeded vector in InitUPnP()
This commit is contained in:
parent
b5d070b0cf
commit
7ce9f1f984
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue