aboutsummaryrefslogtreecommitdiff
path: root/qga
diff options
context:
space:
mode:
authorPierrick Bouvier <pierrick.bouvier@linaro.org>2023-02-21 16:30:05 +0100
committerKostiantyn Kostiuk <kostyanf14@live.com>2023-03-22 21:02:09 +0200
commit0fcd574b025fccdf14d5140687cafe2bc30b634f (patch)
tree83ae1a74127216c71203f77314906855df8e6e74 /qga
parent9832009d9dd2386664c15cc70f6e6bfe062be8bd (diff)
downloadqemu-0fcd574b025fccdf14d5140687cafe2bc30b634f.zip
qemu-0fcd574b025fccdf14d5140687cafe2bc30b634f.tar.gz
qemu-0fcd574b025fccdf14d5140687cafe2bc30b634f.tar.bz2
qga/vss-win32: fix warning for clang++-15
Reported when compiling with clang-windows-arm64. ../qga/vss-win32/install.cpp:537:9: error: variable 'hr' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (!(ControlService(service, SERVICE_CONTROL_STOP, NULL))) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../qga/vss-win32/install.cpp:545:12: note: uninitialized use occurs here return hr; ^~ Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Fixes: 917ebcb170 ("qga-win: Fix QGA VSS Provider service stop failure") Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Kostiantyn Kostiuk <kostyanf14@live.com>
Diffstat (limited to 'qga')
-rw-r--r--qga/vss-win32/install.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qga/vss-win32/install.cpp b/qga/vss-win32/install.cpp
index b57508f..b8087e5 100644
--- a/qga/vss-win32/install.cpp
+++ b/qga/vss-win32/install.cpp
@@ -518,7 +518,7 @@ namespace _com_util
/* Stop QGA VSS provider service using Winsvc API */
STDAPI StopService(void)
{
- HRESULT hr;
+ HRESULT hr = S_OK;
SC_HANDLE manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
SC_HANDLE service = NULL;