From 67c5bdfdfec591b44495533bbcb4e2dede96650c Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 6 Jan 2020 13:35:08 -0800 Subject: [PATCH] GUACAMOLE-249: Do not attempt to free SVC-specific data if it hasn't actually been allocated. --- src/protocols/rdp/channels/pipe-svc.c | 2 ++ src/protocols/rdp/channels/rdpdr/rdpdr.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/protocols/rdp/channels/pipe-svc.c b/src/protocols/rdp/channels/pipe-svc.c index e918fe7c..2db42d68 100644 --- a/src/protocols/rdp/channels/pipe-svc.c +++ b/src/protocols/rdp/channels/pipe-svc.c @@ -209,6 +209,8 @@ void guac_rdp_pipe_svc_process_receive(guac_rdp_common_svc* svc, void guac_rdp_pipe_svc_process_terminate(guac_rdp_common_svc* svc) { guac_rdp_pipe_svc* pipe_svc = (guac_rdp_pipe_svc*) svc->data; + if (pipe_svc == NULL) + return; /* Remove and free SVC */ guac_rdp_pipe_svc_remove(svc->client, svc->name); diff --git a/src/protocols/rdp/channels/rdpdr/rdpdr.c b/src/protocols/rdp/channels/rdpdr/rdpdr.c index f67a55be..e04bc9d7 100644 --- a/src/protocols/rdp/channels/rdpdr/rdpdr.c +++ b/src/protocols/rdp/channels/rdpdr/rdpdr.c @@ -150,6 +150,8 @@ void guac_rdpdr_process_connect(guac_rdp_common_svc* svc) { void guac_rdpdr_process_terminate(guac_rdp_common_svc* svc) { guac_rdpdr* rdpdr = (guac_rdpdr*) svc->data; + if (rdpdr == NULL) + return; int i;