[PATCH] vbscript: Global_Split free delimiter only if it was allocated.

Robert Wilhelm robert.wilhelm at gmx.net
Mon Sep 28 08:44:10 CDT 2020


Signed-off-by: Robert Wilhelm <robert.wilhelm at gmx.net>
---
This fixes valgrind complaining:
==31467== Conditional jump or move depends on uninitialised value(s)
==31467==    at 0x7F338E9: Global_Split (global.c:2461)
In practice it did not matter, because SysFreeString(NULL) is a no-op.
---
 dlls/vbscript/global.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c
index 89780777216..4b1c23b838c 100644
--- a/dlls/vbscript/global.c
+++ b/dlls/vbscript/global.c
@@ -2458,7 +2458,7 @@ error:
     heap_free(indices);
     if(V_VT(args) != VT_BSTR)
         SysFreeString(string);
-    if(V_VT(args+1) != VT_BSTR)
+    if(args_cnt > 1 && V_VT(args+1) != VT_BSTR)
         SysFreeString(delimiter);
     return hres;
 }
--
2.26.2





More information about the wine-devel mailing list