mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Fix potential segfault on malloc failure
[originally from svn r323]
This commit is contained in:
parent
5fa57669ec
commit
55b8c21f0f
6
window.c
6
window.c
@ -678,8 +678,10 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
|
|||||||
cl = malloc(16 + strlen(session)); /* 8, but play safe */
|
cl = malloc(16 + strlen(session)); /* 8, but play safe */
|
||||||
if (!cl)
|
if (!cl)
|
||||||
cl = NULL; /* not a very important failure mode */
|
cl = NULL; /* not a very important failure mode */
|
||||||
sprintf(cl, "putty @%s", session);
|
else {
|
||||||
freecl = TRUE;
|
sprintf(cl, "putty @%s", session);
|
||||||
|
freecl = TRUE;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
cl = NULL;
|
cl = NULL;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user