mirror of https://github.com/FreeRDP/FreeRDP
Fixed return value for failed malloc.
This commit is contained in:
parent
36cbf1b583
commit
d06723e297
|
@ -232,7 +232,7 @@ UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance)
|
||||||
{
|
{
|
||||||
UINT error = CHANNEL_RC_OK;
|
UINT error = CHANNEL_RC_OK;
|
||||||
int index;
|
int index;
|
||||||
char* name;
|
char* name = NULL;
|
||||||
char* hostname;
|
char* hostname;
|
||||||
int hostnameLength;
|
int hostnameLength;
|
||||||
CHANNEL_CLIENT_DATA* pChannelClientData;
|
CHANNEL_CLIENT_DATA* pChannelClientData;
|
||||||
|
@ -259,7 +259,10 @@ UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance)
|
||||||
|
|
||||||
name = (char*) malloc(9);
|
name = (char*) malloc(9);
|
||||||
if (!name)
|
if (!name)
|
||||||
return -1;
|
{
|
||||||
|
error = CHANNEL_RC_NO_MEMORY;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
CopyMemory(name, pChannelOpenData->name, 8);
|
CopyMemory(name, pChannelOpenData->name, 8);
|
||||||
name[8] = '\0';
|
name[8] = '\0';
|
||||||
|
|
||||||
|
@ -282,6 +285,7 @@ UINT freerdp_channels_post_connect(rdpChannels* channels, freerdp* instance)
|
||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
free (name);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue