From 5a6c061f37ae32db0f079a2fa40f93123f858e6f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:44:25 +0000 Subject: [PATCH] use wxCharTypeBuffer replace unsigned char pointer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/x11/clipbrd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x11/clipbrd.cpp b/src/x11/clipbrd.cpp index 46c44608f0..dd6eeff001 100644 --- a/src/x11/clipbrd.cpp +++ b/src/x11/clipbrd.cpp @@ -519,11 +519,11 @@ bool wxClipboard::AddData( wxDataObject *data ) Window window = RootWindow(xdisplay, xscreen); size_t size = m_data->GetDataSize(wxDF_UNICODETEXT); - unsigned char* buf = (unsigned char*)malloc(size); - m_data->GetDataHere(wxDF_UNICODETEXT, buf); + wxCharTypeBuffer buf(size); + m_data->GetDataHere(wxDF_UNICODETEXT, buf.data()); XChangeProperty(xdisplay, window, XA_CLIPBOARD, XA_STRING, 8, PropModeReplace, - buf, size); + buf.data(), size); delete buf;