summaryrefslogtreecommitdiffstats
path: root/remote-processor
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2014-12-19 15:11:21 +0100
committerEric Laurent <elaurent@google.com>2015-04-24 13:32:47 -0700
commit0a7b18ef0f72b4a90b663c0564de632a70d6bc5f (patch)
treee2b61855415d42180b1431de232b4be88928c131 /remote-processor
parent4e69cce75acbdaf9cf2933c229908dc910f29a9f (diff)
downloadexternal_parameter-framework-0a7b18ef0f72b4a90b663c0564de632a70d6bc5f.zip
external_parameter-framework-0a7b18ef0f72b4a90b663c0564de632a70d6bc5f.tar.gz
external_parameter-framework-0a7b18ef0f72b4a90b663c0564de632a70d6bc5f.tar.bz2
[remote-processor] Remove useless new
Message::readString was temporally allocating a buffer on the heap (with new). Use variable length arrays to allocate the buffer on the stack. Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com>
Diffstat (limited to 'remote-processor')
-rw-r--r--remote-processor/Message.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/remote-processor/Message.cpp b/remote-processor/Message.cpp
index ee3652d..8521117 100644
--- a/remote-processor/Message.cpp
+++ b/remote-processor/Message.cpp
@@ -98,7 +98,7 @@ void CMessage::readString(string& strData)
readData(&uiSize, sizeof(uiSize));
// Data
- char* pcData = new char[uiSize + 1];
+ char pcData[uiSize + 1];
// Content
readData(pcData, uiSize);
@@ -108,9 +108,6 @@ void CMessage::readString(string& strData)
// Output
strData = pcData;
-
- // Delete
- delete [] pcData;
}
uint32_t CMessage::getStringSize(const string& strData) const