]> xenbits.xensource.com Git - pvdrivers/win/xennet.git/commitdiff
Fix build warnings
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 3 Nov 2016 10:15:05 +0000 (10:15 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 3 Nov 2016 10:15:24 +0000 (10:15 +0000)
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/coinst/coinst.c

index acbb5ff2de9a42b8bff4c81bd6c2b85b6d923e17..f508ead3756ae7c5afaf405b0ed60d44ee3427d2 100644 (file)
@@ -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;