From 90801a456ffbe527d0f8c43e51d4392f6e6a541e Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Mon, 4 Sep 2023 14:46:06 -0700 Subject: [PATCH] posix shm, init fd to -1, check shmemptr instead of shmemfd --- module/rdpClientCon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/rdpClientCon.c b/module/rdpClientCon.c index 10edb931..d0952e39 100644 --- a/module/rdpClientCon.c +++ b/module/rdpClientCon.c @@ -215,6 +215,7 @@ rdpClientConGotConnection(ScreenPtr pScreen, rdpPtr dev) clientCon->shmemstatus = SHM_UNINITIALIZED; clientCon->updateRetries = 0; clientCon->dev = dev; + clientCon->shmemfd = -1; dev->last_event_time_ms = GetTimeInMillis(); dev->do_dirty_ons = 1; @@ -698,7 +699,7 @@ rdpClientConAllocateSharedMemory(rdpClientCon *clientCon, int bytes) clientCon->shmemfd)); return; } - if (clientCon->shmemfd != -1) + if (clientCon->shmemptr != NULL) { g_free_unmap_fd(clientCon->shmemptr, clientCon->shmemfd,