[PATCH] jscript: Fixed uninitialized usage of i (Coverity)
Marcus Meissner
marcus at jet.franken.de
Thu Dec 10 16:56:21 CST 2009
Hi,
i is uninitialized if argc == 0 , so check for argc > 0.
Ciao, Marcus
---
dlls/jscript/function.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c
index 7819bc4..0e35758 100644
--- a/dlls/jscript/function.c
+++ b/dlls/jscript/function.c
@@ -724,9 +724,11 @@ static HRESULT construct_function(script_ctx_t *ctx, DISPPARAMS *dp, jsexcept_t
}
}
- while(--i >= 0)
- SysFreeString(params[i]);
- heap_free(params);
+ if (argc) {
+ while(--i >= 0)
+ SysFreeString(params[i]);
+ heap_free(params);
+ }
if(FAILED(hres))
return hres;
--
1.5.6
More information about the wine-patches
mailing list