diff options
author | Adam Tkac <atkac@redhat.com> | 2009-09-04 10:16:58 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2009-09-04 10:16:58 +0000 |
commit | 97abe8a548ff9ca940d568128b21813b8a253872 (patch) | |
tree | d38ea6a539b2cc4e70d9569e71985914818546cd /unix/xserver | |
parent | 8ed9009b4c4f497a95114d878334de3e13457bdd (diff) | |
download | tigervnc-97abe8a548ff9ca940d568128b21813b8a253872.tar.gz tigervnc-97abe8a548ff9ca940d568128b21813b8a253872.zip |
Replace rfb::strDup by safe_strdup and remove rfb::strFree in favor of free()
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3889 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/xserver')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 66c92d29..e8e49494 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -219,7 +219,7 @@ void XserverDesktop::setFramebuffer(int w, int h, void* fbptr, int stride) char* XserverDesktop::substitute(const char* varName) { if (strcmp(varName, "$$") == 0) { - return rfb::strDup("$"); + return safe_strdup("$"); } if (strcmp(varName, "$PORT") == 0) { char* str = new char[10]; @@ -247,7 +247,7 @@ char* XserverDesktop::substitute(const char* varName) return str; } if (strcmp(varName, "$DESKTOP") == 0) { - return rfb::strDup(server->getName()); + return safe_strdup(server->getName()); } if (strcmp(varName, "$DISPLAY") == 0) { struct utsname uts; @@ -260,7 +260,7 @@ char* XserverDesktop::substitute(const char* varName) } if (strcmp(varName, "$USER") == 0) { struct passwd* user = getpwuid(getuid()); - return rfb::strDup(user ? user->pw_name : "?"); + return safe_strdup(user ? user->pw_name : "?"); } return 0; } @@ -270,13 +270,13 @@ XserverDesktop::queryConnection(network::Socket* sock, const char* userName, char** reason) { if (queryConnectId) { - *reason = strDup("Another connection is currently being queried."); + *reason = safe_strdup("Another connection is currently being queried."); return rfb::VNCServerST::REJECT; } queryConnectAddress.replaceBuf(sock->getPeerAddress()); if (!userName) userName = "(anonymous)"; - queryConnectUsername.replaceBuf(strDup(userName)); + queryConnectUsername.replaceBuf(safe_strdup(userName)); queryConnectId = sock; vncQueryConnect(this, sock); return rfb::VNCServerST::PENDING; |