From: Paul Durrant Date: Thu, 3 Nov 2016 10:15:05 +0000 (+0000) Subject: Fix build warnings X-Git-Tag: 8.2.0-rc1~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=820166eaa7cf5f1b5ca68795d860d1fafee5004b;p=pvdrivers%2Fwin%2Fxennet.git Fix build warnings Signed-off-by: Paul Durrant --- diff --git a/src/coinst/coinst.c b/src/coinst/coinst.c index acbb5ff..f508ead 100644 --- a/src/coinst/coinst.c +++ b/src/coinst/coinst.c @@ -108,15 +108,16 @@ __GetErrorMessage( PTCHAR Message; ULONG Index; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - Error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR)&Message, - 0, - NULL); + if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + Error, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&Message, + 0, + NULL)) + return NULL; for (Index = 0; Message[Index] != '\0'; Index++) { if (Message[Index] == '\r' || Message[Index] == '\n') { @@ -243,14 +244,14 @@ AllowUpdate( goto fail3; } + RegCloseKey(ServiceKey); + done: if (Value == 0) { Log("DISALLOWED"); *Allow = FALSE; } - RegCloseKey(ServiceKey); - Log("<===="); return TRUE;