diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 2668f3bc0..e2179f4df 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -565,7 +565,7 @@ BOOL freerdp_shall_disconnect(freerdp* instance) BOOL freerdp_shall_disconnect_context(rdpContext* context) { - if (!context) + if (!context || !context->abortEvent) return FALSE; if (WaitForSingleObject(context->abortEvent, 0) != WAIT_OBJECT_0) diff --git a/libfreerdp/core/utils.c b/libfreerdp/core/utils.c index 139c1a433..15cd65598 100644 --- a/libfreerdp/core/utils.c +++ b/libfreerdp/core/utils.c @@ -47,8 +47,9 @@ BOOL utils_str_copy(const char* value, char** dst) BOOL utils_abort_connect(rdpContext* context) { WINPR_ASSERT(context); - - return SetEvent(context->abortEvent); + if (context->abortEvent) + return SetEvent(context->abortEvent); + return FALSE; } BOOL utils_reset_abort(rdpContext* context)