mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Fix memory leak.
This commit is contained in:
parent
01129d02b3
commit
4fe9a4fe83
1 changed files with 24 additions and 19 deletions
|
@ -993,12 +993,11 @@ uint64_t Network::handleConfigChunk(const Packet &chunk,unsigned int ptr)
|
||||||
try {
|
try {
|
||||||
if (nc->fromDictionary(c->data)) {
|
if (nc->fromDictionary(c->data)) {
|
||||||
this->_setConfiguration(*nc,true);
|
this->_setConfiguration(*nc,true);
|
||||||
|
delete nc;
|
||||||
return configUpdateId;
|
return configUpdateId;
|
||||||
}
|
}
|
||||||
delete nc;
|
} catch ( ... ) {}
|
||||||
} catch ( ... ) {
|
delete nc;
|
||||||
delete nc;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1025,25 +1024,31 @@ void Network::requestConfiguration()
|
||||||
|
|
||||||
if (ctrl == RR->identity.address()) {
|
if (ctrl == RR->identity.address()) {
|
||||||
if (RR->localNetworkController) {
|
if (RR->localNetworkController) {
|
||||||
NetworkConfig nconf;
|
NetworkConfig *nconf = new NetworkConfig();
|
||||||
switch(RR->localNetworkController->doNetworkConfigRequest(InetAddress(),RR->identity,RR->identity,_id,rmd,nconf)) {
|
try {
|
||||||
case NetworkController::NETCONF_QUERY_OK: {
|
switch(RR->localNetworkController->doNetworkConfigRequest(InetAddress(),RR->identity,RR->identity,_id,rmd,*nconf)) {
|
||||||
Mutex::Lock _l(_lock);
|
case NetworkController::NETCONF_QUERY_OK: {
|
||||||
this->_setConfiguration(nconf,true);
|
Mutex::Lock _l(_lock);
|
||||||
} return;
|
this->_setConfiguration(*nconf,true);
|
||||||
case NetworkController::NETCONF_QUERY_OBJECT_NOT_FOUND:
|
} break;
|
||||||
this->setNotFound();
|
case NetworkController::NETCONF_QUERY_OBJECT_NOT_FOUND:
|
||||||
return;
|
this->setNotFound();
|
||||||
case NetworkController::NETCONF_QUERY_ACCESS_DENIED:
|
break;
|
||||||
this->setAccessDenied();
|
case NetworkController::NETCONF_QUERY_ACCESS_DENIED:
|
||||||
return;
|
this->setAccessDenied();
|
||||||
default:
|
break;
|
||||||
return;
|
default:
|
||||||
|
this->setNotFound();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch ( ... ) {
|
||||||
|
this->setNotFound();
|
||||||
}
|
}
|
||||||
|
delete nconf;
|
||||||
} else {
|
} else {
|
||||||
this->setNotFound();
|
this->setNotFound();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("requesting netconf for network %.16llx from controller %s",(unsigned long long)_id,ctrl.toString().c_str());
|
TRACE("requesting netconf for network %.16llx from controller %s",(unsigned long long)_id,ctrl.toString().c_str());
|
||||||
|
|
Loading…
Add table
Reference in a new issue