1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 12:02:47 -05:00

Make memory management uniform: _everything_ now goes through the

smalloc() macros and thence to the safemalloc() functions in misc.c.
This should allow me to plug in a debugging allocator and track
memory leaks and segfaults and things.

[originally from svn r818]
This commit is contained in:
Simon Tatham
2000-12-12 10:33:13 +00:00
parent 8eca227b92
commit d5240d4157
20 changed files with 201 additions and 183 deletions

View File

@ -66,7 +66,7 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
int *selitems;
selcount = SendDlgItemMessage(hwnd, IDN_LIST,
LB_GETSELCOUNT, 0, 0);
selitems = malloc(selcount * sizeof(int));
selitems = smalloc(selcount * sizeof(int));
if (selitems) {
int count = SendDlgItemMessage(hwnd, IDN_LIST,
LB_GETSELITEMS,
@ -85,7 +85,7 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
for (i = 0; i < count; i++)
size += strlen(events[selitems[i]]) + sizeof(sel_nl);
clipdata = malloc(size);
clipdata = smalloc(size);
if (clipdata) {
char *p = clipdata;
for (i = 0; i < count; i++) {
@ -97,9 +97,9 @@ static int CALLBACK LogProc (HWND hwnd, UINT msg,
p += sizeof(sel_nl);
}
write_clip(clipdata, size, TRUE);
free(clipdata);
sfree(clipdata);
}
free(selitems);
sfree(selitems);
for (i = 0; i < nevents; i++)
SendDlgItemMessage(hwnd, IDN_LIST, LB_SETSEL,