projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make memory management uniform: _everything_ now goes through the
[u/mdw/putty]
/
window.c
diff --git
a/window.c
b/window.c
index
572b0c5
..
1568617
100644
(file)
--- a/
window.c
+++ b/
window.c
@@
-413,9
+413,10
@@
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
{
char *bits;
int size = (font_width+15)/16 * 2 * font_height;
{
char *bits;
int size = (font_width+15)/16 * 2 * font_height;
- bits = calloc(size, 1);
+ bits = smalloc(size);
+ memset(bits, 0, size);
caretbm = CreateBitmap(font_width, font_height, 1, 1, bits);
caretbm = CreateBitmap(font_width, font_height, 1, 1, bits);
- free(bits);
+
s
free(bits);
}
/*
}
/*
@@
-1130,7
+1131,7
@@
static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
cl = c;
} else if (wParam == IDM_SAVEDSESS) {
char *session = sessions[(lParam - IDM_SAVED_MIN) / 16];
cl = c;
} else if (wParam == IDM_SAVEDSESS) {
char *session = sessions[(lParam - IDM_SAVED_MIN) / 16];
- cl = malloc(16 + strlen(session)); /* 8, but play safe */
+ cl =
s
malloc(16 + strlen(session)); /* 8, but play safe */
if (!cl)
cl = NULL; /* not a very important failure mode */
else {
if (!cl)
cl = NULL; /* not a very important failure mode */
else {
@@
-1154,7
+1155,7
@@
static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
if (filemap)
CloseHandle(filemap);
if (freecl)
if (filemap)
CloseHandle(filemap);
if (freecl)
- free(cl);
+
s
free(cl);
}
break;
case IDM_RECONF:
}
break;
case IDM_RECONF: