mirror of
https://github.com/glfw/glfw.git
synced 2025-06-14 11:42:16 +00:00
Win32: Plug potential memory leaks
This commit is contained in:
parent
d97e954aa3
commit
e4c4c7343c
@ -868,10 +868,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||
if (ctext != window->ctext) {
|
||||
unsigned int* preeditText = _glfw_realloc(window->preeditText, sizeof(unsigned int)*ctext);
|
||||
if (preeditText == NULL) {
|
||||
return 0;
|
||||
_glfw_free(buffer);
|
||||
_glfw_free(attributes);
|
||||
_glfw_free(clauses);
|
||||
return 0;
|
||||
}
|
||||
window->preeditText = preeditText;
|
||||
window->ctext = ctext;
|
||||
@ -894,10 +894,10 @@ static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM l
|
||||
if (cblocks != window->cblocks) {
|
||||
int* blocks = _glfw_realloc(window->preeditAttributeBlocks, sizeof(int)*cblocks);
|
||||
if (blocks == NULL) {
|
||||
return 0;
|
||||
_glfw_free(buffer);
|
||||
_glfw_free(attributes);
|
||||
_glfw_free(clauses);
|
||||
return 0;
|
||||
}
|
||||
window->preeditAttributeBlocks = blocks;
|
||||
window->cblocks = cblocks;
|
||||
|
Loading…
Reference in New Issue
Block a user