aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/ServerParams.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2023-01-17 16:38:59 +0100
committerPierre Ossman <ossman@cendio.se>2023-02-04 14:03:13 +0100
commitadaedc9629c5f4b124a1872bac6a11844b7f576e (patch)
treed6f37a99b42e8e576fd94b0172e4a270f1a56f41 /common/rfb/ServerParams.cxx
parentb99daadb05e14e85da6c5e905057e10fc27c0fcf (diff)
downloadtigervnc-adaedc9629c5f4b124a1872bac6a11844b7f576e.tar.gz
tigervnc-adaedc9629c5f4b124a1872bac6a11844b7f576e.zip
Use std::string for string memory management
Avoids a bit of complexity by delegating that handling to a string object.
Diffstat (limited to 'common/rfb/ServerParams.cxx')
-rw-r--r--common/rfb/ServerParams.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/common/rfb/ServerParams.cxx b/common/rfb/ServerParams.cxx
index 62fbde91..6af446c2 100644
--- a/common/rfb/ServerParams.cxx
+++ b/common/rfb/ServerParams.cxx
@@ -33,7 +33,7 @@ ServerParams::ServerParams()
supportsQEMUKeyEvent(false),
supportsSetDesktopSize(false), supportsFence(false),
supportsContinuousUpdates(false),
- width_(0), height_(0), name_(0),
+ width_(0), height_(0),
ledState_(ledUnknown)
{
setName("");
@@ -46,7 +46,6 @@ ServerParams::ServerParams()
ServerParams::~ServerParams()
{
- delete [] name_;
delete cursor_;
}
@@ -77,8 +76,7 @@ void ServerParams::setPF(const PixelFormat& pf)
void ServerParams::setName(const char* name)
{
- delete [] name_;
- name_ = strDup(name);
+ name_ = name;
}
void ServerParams::setCursor(const Cursor& other)