[PATCH] gameux: move SysFreeString to success branches (Coverity)

Marcus Meissner meissner at suse.de
Sun Sep 2 07:47:15 CDT 2012


Hi,

only useful in success cases, otherwise its uninitialized.

CID 718733

Ciao, Marcus
---
 dlls/gameux/gamestatistics.c |    6 ++----
 1 Datei geändert, 2 Zeilen hinzugefügt(+), 4 Zeilen entfernt(-)

diff --git a/dlls/gameux/gamestatistics.c b/dlls/gameux/gamestatistics.c
index f069708..619c616 100644
--- a/dlls/gameux/gamestatistics.c
+++ b/dlls/gameux/gamestatistics.c
@@ -240,10 +240,9 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats)
                     {
                         TRACE("    storing statistic %d: name: %s\n", j, debugstr_w(V_BSTR(&vValue)));
                         hr = IXMLDOMElement_setAttribute(statisticsElement, bstrName, vValue);
+                        SysFreeString(V_BSTR(&vValue));
                     }
 
-                    SysFreeString(V_BSTR(&vValue));
-
                     if(SUCCEEDED(hr))
                     {
                         V_VT(&vValue) = VT_BSTR;
@@ -256,10 +255,9 @@ static HRESULT GAMEUX_updateStatisticsFile(struct GAMEUX_STATS *stats)
                     {
                         TRACE("    storing statistic %d: name: %s\n", j, debugstr_w(V_BSTR(&vValue)));
                         hr = IXMLDOMElement_setAttribute(statisticsElement, bstrValue, vValue);
+                        SysFreeString(V_BSTR(&vValue));
                     }
 
-                    SysFreeString(V_BSTR(&vValue));
-
                     if(SUCCEEDED(hr))
                         hr = IXMLDOMNode_appendChild(categoryNode, statisticsNode, &statisticsNode);
 
-- 
1.7.10.4




More information about the wine-patches mailing list