rdp: Fix invalid free and memory leak on error

Peer context creation's error handling labels must be swapped to avoid
an invalid free when nsc context creation fails and a leak of the rfx
context when encode stream creation fails.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This commit is contained in:
Loïc Molinari 2024-07-22 16:01:58 +02:00 committed by Marius Vlad
parent ee5b6bcc30
commit db66a64aab
1 changed files with 2 additions and 2 deletions

View File

@ -765,10 +765,10 @@ rdp_peer_context_new(freerdp_peer* client, RdpPeerContext* context)
return TRUE;
out_error_nsc:
rfx_context_free(context->rfx_context);
out_error_stream:
nsc_context_free(context->nsc_context);
out_error_nsc:
rfx_context_free(context->rfx_context);
return FALSE;
}