~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Another big batch of memory leak fixes, again mostly on error paths.
[sgt/putty]
/
windows
/
window.c
diff --git
a/windows/window.c
b/windows/window.c
index
b2a5c5c
..
b477d6a
100644
(file)
--- a/
windows/window.c
+++ b/
windows/window.c
@@
-2197,8
+2197,10
@@
static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
reconfig_result =
do_reconfig(hwnd, back ? back->cfg_info(backhandle) : 0);
reconfiguring = FALSE;
reconfig_result =
do_reconfig(hwnd, back ? back->cfg_info(backhandle) : 0);
reconfiguring = FALSE;
- if (!reconfig_result)
+ if (!reconfig_result) {
+ conf_free(prev_conf);
break;
break;
+ }
conf_cache_data();
conf_cache_data();
@@
-4903,10
+4905,17
@@
void write_clip(void *frontend, wchar_t * data, int *attr, int len, int must_des
GlobalFree(clipdata2);
return;
}
GlobalFree(clipdata2);
return;
}
- if (!(lock = GlobalLock(clipdata)))
+ if (!(lock = GlobalLock(clipdata))) {
+ GlobalFree(clipdata);
+ GlobalFree(clipdata2);
return;
return;
- if (!(lock2 = GlobalLock(clipdata2)))
+ }
+ if (!(lock2 = GlobalLock(clipdata2))) {
+ GlobalUnlock(clipdata);
+ GlobalFree(clipdata);
+ GlobalFree(clipdata2);
return;
return;
+ }
memcpy(lock, data, len * sizeof(wchar_t));
WideCharToMultiByte(CP_ACP, 0, data, len, lock2, len2, NULL, NULL);
memcpy(lock, data, len * sizeof(wchar_t));
WideCharToMultiByte(CP_ACP, 0, data, len, lock2, len2, NULL, NULL);