#6037 Fix potential memory leak if SetClipboardData fails
This commit is contained in:
parent
7deb5f04f3
commit
823868f767
|
@ -88,7 +88,11 @@ MSWindowsClipboard::empty()
|
||||||
|
|
||||||
// mark clipboard as being owned by synergy
|
// mark clipboard as being owned by synergy
|
||||||
HGLOBAL data = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, 1);
|
HGLOBAL data = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, 1);
|
||||||
SetClipboardData(getOwnershipFormat(), data);
|
if (NULL == SetClipboardData(getOwnershipFormat(), data)) {
|
||||||
|
LOG((CLOG_DEBUG "failed to set clipboard data"));
|
||||||
|
GlobalFree(data);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue