* Fixed destruction order of lock/reference that could lead to access already
deleted memory. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35467 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "UnixEndpoint.h"
|
#include "UnixEndpoint.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -431,6 +432,8 @@ UnixEndpoint::Send(const iovec *vecs, size_t vecCount,
|
|||||||
gStackModule->store_syscall_restart_timeout(timeout);
|
gStackModule->store_syscall_restart_timeout(timeout);
|
||||||
|
|
||||||
UnixEndpointLocker locker(this);
|
UnixEndpointLocker locker(this);
|
||||||
|
|
||||||
|
Reference<UnixEndpoint> peerReference;
|
||||||
UnixEndpointLocker peerLocker;
|
UnixEndpointLocker peerLocker;
|
||||||
|
|
||||||
status_t error = _LockConnectedEndpoints(locker, peerLocker);
|
status_t error = _LockConnectedEndpoints(locker, peerLocker);
|
||||||
@@ -438,7 +441,7 @@ UnixEndpoint::Send(const iovec *vecs, size_t vecCount,
|
|||||||
RETURN_ERROR(error);
|
RETURN_ERROR(error);
|
||||||
|
|
||||||
UnixEndpoint* peerEndpoint = fPeerEndpoint;
|
UnixEndpoint* peerEndpoint = fPeerEndpoint;
|
||||||
Reference<UnixEndpoint> peerReference(peerEndpoint);
|
peerReference.SetTo(peerEndpoint);
|
||||||
|
|
||||||
// lock the peer's FIFO
|
// lock the peer's FIFO
|
||||||
UnixFifo* peerFifo = peerEndpoint->fReceiveFifo;
|
UnixFifo* peerFifo = peerEndpoint->fReceiveFifo;
|
||||||
|
|||||||
Reference in New Issue
Block a user