Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-du-car committed Apr 9, 2024
1 parent 9ac6eda commit 66a8390
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ namespace TelematicBridge
// increase size of buffer.
size_t new_size = 2 * (xb->allocated_size ? xb->allocated_size : 64);
auto new_buf = static_cast<char *>(MALLOC(new_size));
// auto new_buf = new char[new_size];
if (!new_buf)
return -1;
// move old to new.
Expand Down Expand Up @@ -147,7 +148,9 @@ namespace TelematicBridge
{
throw TelematicBridgeException("Failed to convert message with ID (=" + to_string(messageFrame->messageId) + ") to XML ");
}
return string(xml_buffer.buffer);
auto output = string(xml_buffer.buffer);
FREEMEM(xml_buffer.buffer);
return output;
}

/**
Expand Down

0 comments on commit 66a8390

Please sign in to comment.