X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4ba9b64bfae2a77b1c8376d027f26e172ec1412d..f5e6a5c6dcefee95163f75ca6121255e22f87a2d:/windlg.c?ds=inline diff --git a/windlg.c b/windlg.c index 575642b9..af430ecb 100644 --- a/windlg.c +++ b/windlg.c @@ -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, @@ -1164,6 +1164,8 @@ static int GenericMainDlgProc (HWND hwnd, UINT msg, init_dlg_ctrls(hwnd); if (!isdef) SetDlgItemText(hwnd, IDC_SESSEDIT, sessions[n]); + else + SetDlgItemText(hwnd, IDC_SESSEDIT, ""); } if (LOWORD(wParam) == IDC_SESSLIST) { /*