summaryrefslogtreecommitdiffstats
path: root/src/qlibwindowmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qlibwindowmanager.cpp')
-rw-r--r--src/qlibwindowmanager.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qlibwindowmanager.cpp b/src/qlibwindowmanager.cpp
index b5fad2c..bc313e5 100644
--- a/src/qlibwindowmanager.cpp
+++ b/src/qlibwindowmanager.cpp
@@ -33,8 +33,7 @@ int QLibWindowmanager::init(int port, const QString &token) {
int QLibWindowmanager::requestSurface(const QString &label) {
string cstr = label.toStdString();
- applabel = new char[cstr.length() + 1];
- memcpy(applabel, cstr.c_str(), cstr.length() + 1);
+ applabel = strdup(cstr.c_str());
json_object *obj = json_object_new_object();
json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(applabel));