mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed NULL pointer checks.
This commit is contained in:
@@ -224,10 +224,11 @@ static UINT audin_server_recv_formats(audin_server* audin, wStream* s,
|
||||
return ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
audin->context.client_formats = malloc(audin->context.num_client_formats *
|
||||
audin->context.client_formats = calloc(audin->context.num_client_formats,
|
||||
sizeof(AUDIO_FORMAT));
|
||||
ZeroMemory(audin->context.client_formats,
|
||||
audin->context.num_client_formats * sizeof(AUDIO_FORMAT));
|
||||
|
||||
if (!audin->context.client_formats)
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
|
||||
for (i = 0; i < audin->context.num_client_formats; i++)
|
||||
{
|
||||
|
||||
@@ -224,9 +224,12 @@ static void rdpsnd_select_supported_audio_formats(rdpsndPlugin* rdpsnd)
|
||||
if (!rdpsnd->NumberOfServerFormats)
|
||||
return;
|
||||
|
||||
rdpsnd->ClientFormats = (AUDIO_FORMAT*) malloc(sizeof(AUDIO_FORMAT) *
|
||||
rdpsnd->ClientFormats = (AUDIO_FORMAT*) calloc(sizeof(AUDIO_FORMAT),
|
||||
rdpsnd->NumberOfServerFormats);
|
||||
|
||||
if (!rdpsnd->ClientFormats)
|
||||
return;
|
||||
|
||||
for (index = 0; index < (int) rdpsnd->NumberOfServerFormats; index++)
|
||||
{
|
||||
serverFormat = &rdpsnd->ServerFormats[index];
|
||||
@@ -799,7 +802,6 @@ static UINT rdpsnd_load_device_plugin(rdpsndPlugin* rdpsnd, const char* name,
|
||||
{
|
||||
PFREERDP_RDPSND_DEVICE_ENTRY entry;
|
||||
FREERDP_RDPSND_DEVICE_ENTRY_POINTS entryPoints;
|
||||
\
|
||||
UINT error;
|
||||
entry = (PFREERDP_RDPSND_DEVICE_ENTRY)
|
||||
freerdp_load_channel_addin_entry("rdpsnd", (LPSTR) name, NULL, 0);
|
||||
|
||||
Reference in New Issue
Block a user