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++)
{
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];
{
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);