From: Armin Novak Date: Fri, 2 Oct 2015 07:29:00 +0000 (+0200) Subject: Remove unnecessary copy operation. X-Git-Tag: 2.0.0-beta1+android10~414^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82134fbef33f8b30c9be5e3d88f9d083fa0efaff;p=platform%2Fupstream%2Ffreerdp.git Remove unnecessary copy operation. --- diff --git a/channels/cliprdr/client/cliprdr_format.c b/channels/cliprdr/client/cliprdr_format.c index 9ab3225..e686a7c 100644 --- a/channels/cliprdr/client/cliprdr_format.c +++ b/channels/cliprdr/client/cliprdr_format.c @@ -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; }