Fix metrics leak

This commit is contained in:
Hardening 2014-06-03 14:54:56 +02:00
parent 4f1b77408a
commit 183155dbd1
1 changed files with 3 additions and 2 deletions

View File

@ -431,8 +431,7 @@ void freerdp_peer_context_new(freerdp_peer* client)
{
rdpRdp* rdp;
client->context = (rdpContext*) malloc(client->ContextSize);
ZeroMemory(client->context, client->ContextSize);
client->context = (rdpContext *)calloc(1, client->ContextSize);
client->context->ServerMode = TRUE;
@ -470,6 +469,8 @@ void freerdp_peer_context_new(freerdp_peer* client)
void freerdp_peer_context_free(freerdp_peer* client)
{
IFCALL(client->ContextFree, client, client->context);
metrics_free(client->context->metrics);
}
freerdp_peer* freerdp_peer_new(int sockfd)