Skip to content

Commit

Permalink
Remove unnecessary copy operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
akallabeth committed Oct 2, 2015
1 parent 2d641c4 commit 82134fb
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions channels/cliprdr/client/cliprdr_format.c
Expand Up @@ -306,20 +306,11 @@ UINT cliprdr_process_format_data_response(cliprdrPlugin* cliprdr, wStream* s, UI
formatDataResponse.requestedFormatData = NULL;

if (dataLen)
{
formatDataResponse.requestedFormatData = (BYTE*) malloc(dataLen);
if (!formatDataResponse.requestedFormatData)
{
WLog_ERR(TAG, "malloc failed!");
return CHANNEL_RC_NO_MEMORY;
}
Stream_Read(s, formatDataResponse.requestedFormatData, dataLen);
}
formatDataResponse.requestedFormatData = (BYTE*) Stream_Pointer(s);

IFCALLRET(context->ServerFormatDataResponse, error, context, &formatDataResponse);
if (error)
WLog_ERR(TAG, "ServerFormatDataResponse failed with error %lu!", error);

free(formatDataResponse.requestedFormatData);
return error;
}

0 comments on commit 82134fb

Please sign in to comment.