From d8cabe84ce04fa76fca358c255e9395dc3175e64 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 24 Apr 2024 16:08:11 +0200 Subject: [PATCH] [client,X11] check PubSub for NULL --- client/X11/xf_client.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index 7822d59bf..ed445834b 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -1991,11 +1991,14 @@ static void xfreerdp_client_free(freerdp* instance, rdpContext* context) if (!context) return; - PubSub_UnsubscribeTerminate(context->pubSub, xf_TerminateEventHandler); + if (context->pubSub) + { + PubSub_UnsubscribeTerminate(context->pubSub, xf_TerminateEventHandler); #ifdef WITH_XRENDER - PubSub_UnsubscribeZoomingChange(context->pubSub, xf_ZoomingChangeEventHandler); - PubSub_UnsubscribePanningChange(context->pubSub, xf_PanningChangeEventHandler); + PubSub_UnsubscribeZoomingChange(context->pubSub, xf_ZoomingChangeEventHandler); + PubSub_UnsubscribePanningChange(context->pubSub, xf_PanningChangeEventHandler); #endif + } } int RdpClientEntry(RDP_CLIENT_ENTRY_POINTS* pEntryPoints)