summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-07-19 03:54:12 -0400
committermidipix <writeonce@midipix.org>2016-07-19 03:56:33 -0400
commit862d11239a7b649b53f099f107b67a656b3cd9e7 (patch)
tree25915c76591a5c33f202a06f165bb4fa1023e30c
parentf4367d91199040ac46c9e32d8217786390b64487 (diff)
downloadntapi-862d11239a7b649b53f099f107b67a656b3cd9e7.tar.bz2
ntapi-862d11239a7b649b53f099f107b67a656b3cd9e7.tar.xz
__ntapi_pty_inherit(): re-set client info, free context upon failure.
-rw-r--r--src/pty/ntapi_pty_fd.c13
1 files changed, 12 insertions, 1 deletions
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;