[PATCH] wmp/tests: Fix a minor leak on error path (Coverity)

Nikolay Sivov nsivov at codeweavers.com
Sun Aug 12 14:38:16 CDT 2018


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/wmp/tests/media.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/wmp/tests/media.c b/dlls/wmp/tests/media.c
index 218b80f1e6..aeca6180b0 100644
--- a/dlls/wmp/tests/media.c
+++ b/dlls/wmp/tests/media.c
@@ -309,7 +309,7 @@ static BOOL test_wmp(void)
     LONG progress;
     IWMPMedia *media;
     static const WCHAR currentPosition[] = {'c','u','r','r','e','n','t','P','o','s','i','t','i','o','n',0};
-    BSTR bstrcurrentPosition = SysAllocString(currentPosition);
+    BSTR bstrcurrentPosition;
 
     hres = CoCreateInstance(&CLSID_WindowsMediaPlayer, NULL, CLSCTX_INPROC_SERVER, &IID_IOleObject, (void**)&oleobj);
     if(hres == REGDB_E_CLASSNOTREG) {
@@ -344,6 +344,7 @@ static BOOL test_wmp(void)
     ok(hres == S_OK, "get_controls failed: %08x\n", hres);
     ok(controls != NULL, "controls = NULL\n");
 
+    bstrcurrentPosition = SysAllocString(currentPosition);
     hres = IWMPControls_get_isAvailable(controls, bstrcurrentPosition, &vbool);
     ok(hres == S_OK, "IWMPControls_get_isAvailable failed: %08x\n", hres);
     ok(vbool == VARIANT_FALSE, "unexpected value\n");
-- 
2.18.0




More information about the wine-devel mailing list