Commit b3c41f35 authored by Andreas Kempe's avatar Andreas Kempe

Switched to array delete for packet payload. And adjusted mem alloc.

parent 4f84899a
......@@ -12,7 +12,7 @@ data_packet::data_packet(quint32 op_code, uint payload_size, char* payload) :
data_packet::~data_packet()
{
delete payload;
delete[] payload;
payload = nullptr;
}
......
......@@ -83,8 +83,7 @@ void mandel_socket::decode_packet_data(QByteArray& incoming)
char* payload = nullptr;
if (payload_size > 0)
{
payload = new char[payload_size + 1];
payload[payload_size] = '\0';
payload = new char[payload_size];
reader.readRawData(payload, payload_size);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment