UDP: Fix double-reference of DomainSupport.
PulkoMandy in cb3199681e
changed
the _GetDomainSupport functions to always Ref() the the object.
However, that means in the case of the second _GetDomainSupport
function, which is implemented in terms of the first, we should
not call Ref() as this will create a double-reference.
Fixes a memory leak.
Change-Id: Ib82b2dadc0c8cc8d8f95efcffeb2430ac602a0a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4791
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
c1e0007eea
commit
e94ea7bc22
@ -929,10 +929,7 @@ UdpEndpointManager::_GetDomainSupport(net_buffer* buffer)
|
||||
{
|
||||
MutexLocker _(fLock);
|
||||
|
||||
UdpDomainSupport* support = _GetDomainSupport(_GetDomain(buffer), false);
|
||||
if (support != NULL)
|
||||
support->Ref();
|
||||
return support;
|
||||
return _GetDomainSupport(_GetDomain(buffer), false);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user