* B_SOCKET_SET_ALIAS handling was leaking references.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38079 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-13 10:27:00 +00:00
parent 7e5d6acf69
commit 8dcde8b128
1 changed files with 1 additions and 3 deletions

View File

@ -757,6 +757,7 @@ Interface::Control(net_domain* domain, int32 option, ifreq& request,
// Note, even if setting the address failed, the empty // Note, even if setting the address failed, the empty
// address added here will still be added to the interface. // address added here will still be added to the interface.
address->AcquireReference();
} }
} else } else
address = AddressAt(aliasRequest.ifra_index); address = AddressAt(aliasRequest.ifra_index);
@ -765,9 +766,6 @@ Interface::Control(net_domain* domain, int32 option, ifreq& request,
return B_BAD_VALUE; return B_BAD_VALUE;
status_t status = B_OK; status_t status = B_OK;
address->AcquireReference();
// _ChangeAddress() currently unlocks, so we need another
// reference to make sure "address" is not going away.
if (!domain->address_module->equal_addresses( if (!domain->address_module->equal_addresses(
(sockaddr*)&aliasRequest.ifra_addr, address->local)) { (sockaddr*)&aliasRequest.ifra_addr, address->local)) {