diff options
Diffstat (limited to 'src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp')
-rw-r--r-- | src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp index 6ceb642..3f967dd 100644 --- a/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp +++ b/src/uscxml/plugins/datamodel/ecmascript/JavaScriptCore/dom/JSCAttr.cpp @@ -53,8 +53,9 @@ bool JSCAttr::valueAttrSetter(JSContextRef ctx, JSObjectRef thisObj, JSStringRef JSStringRef stringReflocalValue = JSValueToStringCopy(ctx, value, exception); size_t localValueMaxSize = JSStringGetMaximumUTF8CStringSize(stringReflocalValue); char* localValueBuffer = new char[localValueMaxSize]; - JSStringGetUTF8CString(stringReflocalValue, localValueBuffer, sizeof(localValueBuffer)); - std::string localValue(localValueBuffer, localValueMaxSize); + JSStringGetUTF8CString(stringReflocalValue, localValueBuffer, localValueMaxSize); + std::string localValue(localValueBuffer); + JSStringRelease(stringReflocalValue); free(localValueBuffer); privData->nativeObj->setValue(localValue); |