[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>
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 @@
readData(&uiSize, sizeof(uiSize));
// Data
- char* pcData = new char[uiSize + 1];
+ char pcData[uiSize + 1];
// Content
readData(pcData, uiSize);
@@ -108,9 +108,6 @@
// Output
strData = pcData;
-
- // Delete
- delete [] pcData;
}
uint32_t CMessage::getStringSize(const string& strData) const