From 862d11239a7b649b53f099f107b67a656b3cd9e7 Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 19 Jul 2016 03:54:12 -0400 Subject: __ntapi_pty_inherit(): re-set client info, free context upon failure. --- src/pty/ntapi_pty_fd.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pty/ntapi_pty_fd.c b/src/pty/ntapi_pty_fd.c index a2701a9..ed97418 100644 --- a/src/pty/ntapi_pty_fd.c +++ b/src/pty/ntapi_pty_fd.c @@ -273,8 +273,19 @@ int32_t __stdcall __ntapi_pty_inherit( ctx->luid.low = inherit.luid.low; ctx->luid.high = inherit.luid.high; - if ((status = __ntapi_pty_connect(hport,ctx,&iosb))) + if ((status = __ntapi_pty_connect(hport,ctx,&iosb))) { + __ntapi_pty_free(ctx); return status; + } + + if ((status = __ntapi_pty_set( + ctx,&iosb, + client_info, + sizeof(*client_info), + NT_PTY_CLIENT_INFORMATION))) { + __ntapi_pty_free(ctx); + return status; + } *pty = ctx; -- cgit v1.2.3