[MSI] Prevent uninitialized variable usage
authorMark Jansen <mark.jansen@reactos.org>
Sun, 17 Feb 2019 19:46:47 +0000 (20:46 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Mon, 18 Feb 2019 22:00:54 +0000 (23:00 +0100)
dll/win32/msi/source.c

index 7f55775..960324b 100644 (file)
@@ -592,8 +592,11 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
                               0, 0, NULL, &size);
         if (rc != ERROR_SUCCESS)
         {
-            RegCloseKey(sourcekey);
-            return ERROR_SUCCESS;
+            static WCHAR szEmpty[1] = { '\0' };
+            rc = ERROR_SUCCESS;
+            source = NULL;
+            ptr = szEmpty;
+            goto output_out;
         }
 
         source = msi_alloc(size);
@@ -627,7 +630,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
             else
                 ptr++;
         }
-
+output_out:
         if (szValue)
         {
             if (strlenW(ptr) < *pcchValue)