aboutsummaryrefslogtreecommitdiffstats
path: root/unix/xserver/hw/vnc
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-13 11:14:21 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commit5c1ac16776cd9f2a75e31086755e72186b3b3d41 (patch)
tree234a54c7f11c25ba59f8487118d13eb550c1cc64 /unix/xserver/hw/vnc
parent1af2a56f7583b301890f8ea213f262782cc3c9f1 (diff)
downloadtigervnc-5c1ac16776cd9f2a75e31086755e72186b3b3d41.tar.gz
tigervnc-5c1ac16776cd9f2a75e31086755e72186b3b3d41.zip
Return static char buffer from some methods
This mimics how some system functions (like inet_ntop()) work, and avoids complexity around ownership of the returned string buffer. The downside is that the string must be consumed directly as it will be overwritten on the next call, but that is not an issue with the current usage.
Diffstat (limited to 'unix/xserver/hw/vnc')
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 3b4eee6a..14b111ae 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -172,7 +172,7 @@ void XserverDesktop::queryConnection(network::Socket* sock,
return;
}
- queryConnectAddress.replaceBuf(sock->getPeerAddress());
+ queryConnectAddress.replaceBuf(strDup(sock->getPeerAddress()));
if (!userName)
userName = "(anonymous)";
queryConnectUsername.replaceBuf(strDup(userName));