client/Windows/wf_cliprdr.c: handle malloc error

This commit is contained in:
Ilya Shipitsin 2024-03-22 20:25:25 +01:00 committed by akallabeth
parent 735cb1ec14
commit be50010d1d

View File

@ -2133,6 +2133,8 @@ wf_cliprdr_server_format_data_request(CliprdrClientContext* context,
globlemem = (char*)GlobalLock(hClipdata);
size = (int)GlobalSize(hClipdata);
buff = malloc(size);
if (buff == NULL)
return ERROR_INTERNAL_ERROR;
CopyMemory(buff, globlemem, size);
GlobalUnlock(hClipdata);
CloseClipboard();