summaryrefslogtreecommitdiffstats
path: root/src/OSSupport
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-08-23 13:20:43 +0200
committerMattes D <github@xoft.cz>2016-08-23 13:20:43 +0200
commit5ca371bb9a65cc322eb8327d81709985daefe173 (patch)
tree41f9d786c52985118f444d86721649e1186e6b2d /src/OSSupport
parentcUrlClient: Refactored callbacks to use UniquePtr. (diff)
downloadcuberite-5ca371bb9a65cc322eb8327d81709985daefe173.tar
cuberite-5ca371bb9a65cc322eb8327d81709985daefe173.tar.gz
cuberite-5ca371bb9a65cc322eb8327d81709985daefe173.tar.bz2
cuberite-5ca371bb9a65cc322eb8327d81709985daefe173.tar.lz
cuberite-5ca371bb9a65cc322eb8327d81709985daefe173.tar.xz
cuberite-5ca371bb9a65cc322eb8327d81709985daefe173.tar.zst
cuberite-5ca371bb9a65cc322eb8327d81709985daefe173.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/TCPLinkImpl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/OSSupport/TCPLinkImpl.cpp b/src/OSSupport/TCPLinkImpl.cpp
index df70f3f72..d55dc9da1 100644
--- a/src/OSSupport/TCPLinkImpl.cpp
+++ b/src/OSSupport/TCPLinkImpl.cpp
@@ -322,6 +322,11 @@ void cTCPLinkImpl::EventCallback(bufferevent * a_BufferEvent, short a_What, void
{
ASSERT(a_Self != nullptr);
cTCPLinkImplPtr Self = static_cast<cTCPLinkImpl *>(a_Self)->m_Self;
+ if (Self == nullptr)
+ {
+ // The link has already been freed
+ return;
+ }
// If an error is reported, call the error callback:
if (a_What & BEV_EVENT_ERROR)