From: pius.lee Date: Mon, 8 Jun 2015 07:50:02 +0000 (+0900) Subject: [common] remove unused over allocated memory X-Git-Tag: submit/tizen_mobile/20150612.133019^2~2^2~38^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2bf81915be0604dd07a3de98dfb82ca3a9523b86;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [common] remove unused over allocated memory Change-Id: Ic6cac10bdb3398745e2f3eb2c43ab6b677f7ee42 --- diff --git a/src/common/dbus_operation.cc b/src/common/dbus_operation.cc index ecded9f3..1cb58535 100755 --- a/src/common/dbus_operation.cc +++ b/src/common/dbus_operation.cc @@ -104,8 +104,8 @@ void DBusOperationArguments::AddArgumentString(const std::string& val) { LoggerD("Enter"); const int length = val.length(); - char* p_val = new char[length * 2]; - strncpy(p_val, val.c_str(), length * 2); // TODO: is it safe? + char* p_val = new char[length+1]; + strncpy(p_val, val.c_str(), length+1); // TODO: is it safe? arguments_.push_back(ArgumentElement(ArgType::kTypeString, p_val)); }