Set pEntryPointsEx->ppInterface NULL on error.

This commit is contained in:
Armin Novak 2016-09-26 12:12:14 +02:00
parent 88a3b8dd76
commit 64590e7e89
6 changed files with 111 additions and 86 deletions

View File

@ -1235,7 +1235,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
UINT rc;
cliprdrPlugin* cliprdr;
CliprdrClientContext* context;
CliprdrClientContext* context = NULL;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
cliprdr = (cliprdrPlugin*) calloc(1, sizeof(cliprdrPlugin));
@ -1298,6 +1298,9 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08X]",
WTSErrorToString(rc), rc);
if (context)
*(pEntryPointsEx->ppInterface) = NULL;
free(cliprdr->context);
free(cliprdr);
return FALSE;

View File

@ -1469,7 +1469,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
UINT rc;
drdynvcPlugin* drdynvc;
DrdynvcClientContext* context;
DrdynvcClientContext* context = NULL;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
drdynvc = (drdynvcPlugin*) calloc(1, sizeof(drdynvcPlugin));
@ -1519,6 +1519,9 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
WLog_ERR(TAG, "pVirtualChannelInit failed with %s [%08X]",
WTSErrorToString(rc), rc);
if (context)
*(pEntryPointsEx->ppInterface) = NULL;
free(drdynvc->context);
free(drdynvc);
return FALSE;

View File

@ -1232,7 +1232,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
UINT rc;
encomspPlugin* encomsp;
EncomspClientContext* context;
EncomspClientContext* context = NULL;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
BOOL isFreerdp = FALSE;
encomsp = (encomspPlugin*) calloc(1, sizeof(encomspPlugin));
@ -1301,6 +1301,8 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
s_TLSPluginContext = encomsp;
return TRUE;
error_out:
if (context)
*(pEntryPointsEx->ppInterface) = NULL;
if (isFreerdp)
free(encomsp->context);

View File

@ -759,7 +759,7 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
{
UINT rc;
railPlugin* rail;
RailClientContext* context;
RailClientContext* context = NULL;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
BOOL isFreerdp = FALSE;
rail = (railPlugin*) calloc(1, sizeof(railPlugin));
@ -840,6 +840,9 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
return TRUE;
error_out:
if (context)
*(pEntryPointsEx->ppInterface) = NULL;
if (isFreerdp)
free(rail->context);

View File

@ -1460,6 +1460,12 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
UINT rc;
rdpsndPlugin* rdpsnd;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
if (!pEntryPoints)
{
return FALSE;
}
rdpsnd = (rdpsndPlugin*) calloc(1, sizeof(rdpsndPlugin));
if (!rdpsnd)

View File

@ -1034,6 +1034,12 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
remdeskPlugin* remdesk;
RemdeskClientContext* context = NULL;
CHANNEL_ENTRY_POINTS_FREERDP* pEntryPointsEx;
if (!pEntryPoints)
{
return FALSE;
}
remdesk = (remdeskPlugin*) calloc(1, sizeof(remdeskPlugin));
if (!remdesk)
@ -1088,6 +1094,8 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
s_TLSPluginContext = remdesk;
return TRUE;
error_out:
if (context)
*(pEntryPointsEx->ppInterface) = NULL;
free(remdesk);
free(context);
return FALSE;