Skip to content
Snippets Groups Projects
Unverified Commit caa21839 authored by Dimitrios Stoupis's avatar Dimitrios Stoupis
Browse files

Make subservice safer

parent d959b7d7
No related branches found
No related tags found
No related merge requests found
#include "Services/MemMangService.hpp"
#include <iostream>
#include <cerrno>
// Define the constructors for the classes
MemoryManagementService::MemoryManagementService() : rawDataMemorySubservice(this) {
......@@ -67,6 +68,11 @@ void MemoryManagementService::RawDataMemoryManagement::dumpRawData(Message &requ
// Allocate more array space if needed
if (allocatedLength < readLength) {
readData = static_cast<uint8_t *>(realloc(readData, readLength));
if (!readData) {
// todo: Add error logging and reporting
free(readData);
return;
}
}
// Read memory data, an octet at a time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment