From f238d0d09e7cf6f28a47368bb026b45bd57be8d1 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Fri, 22 Feb 2013 10:35:48 +0000 Subject: [PATCH] gtx: Return failure if gtx_Init can't start thread If LWP_CreateProcess fails in gtx_Init return NULL, rather than silently swallowing the failure. Caught by clang-analyzer Change-Id: I5db5667f9dae3f405e88cf9c57e6b8a069ea28a3 Reviewed-on: http://gerrit.openafs.org/9236 Tested-by: BuildBot Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman --- src/gtx/input.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gtx/input.c b/src/gtx/input.c index 932ce857f..f7303f6aa 100644 --- a/src/gtx/input.c +++ b/src/gtx/input.c @@ -92,10 +92,13 @@ gtx_Init(int astartInput, /* if we start input thread */ IOMGR_Initialize(); /* input thread uses it */ - if (astartInput) - code = - LWP_CreateProcess(gtx_InputServer, 8192, LWP_NORMAL_PRIORITY, - (void *)0, "gx-listener", &junk); + if (astartInput) { + code = LWP_CreateProcess(gtx_InputServer, 8192, LWP_NORMAL_PRIORITY, + NULL, "gx-listener", &junk); + if (code) + return NULL; + } + /* all done */ twin = &gator_basegwin; return twin; -- 2.39.5