Commit 7bb1b8bd authored by Lubomir Bulej's avatar Lubomir Bulej

Cleanup receive_server_message() a bit

Initialize at response at declaration.
parent 35b99552
......@@ -43,12 +43,12 @@ send_client_message(
*/
ServerMessage *
receive_server_message(struct connection * restrict conn) {
void * buffer;
ServerMessage * response;
void * buffer;
size_t recv_size = message_recv(conn, &buffer); // FREE!
response = server_message__unpack(NULL, recv_size, buffer);
ServerMessage * response = server_message__unpack(NULL, recv_size, buffer);
assert(response != NULL);
free(buffer); // FREEING!
return (response);
}
......
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