[winpr,clipboard] fix possible resource leak

This commit is contained in:
akallabeth
2024-12-09 10:07:14 +01:00
parent 3dbbe687ea
commit 951cfd06bc

View File

@@ -78,7 +78,10 @@ static void* clipboard_synthesize_cf_text(wClipboard* clipboard, UINT32 formatId
pDstData = ConvertLineEndingToCRLF(data, &size);
if (!pDstData || (size > *pSize))
{
free(pDstData);
return NULL;
}
*pSize = (UINT32)size;
return pDstData;