jscript: Return NULL if jsstr_alloc_len fails.

Sebastian Lackner sebastian at fds-team.de
Fri Sep 2 10:39:55 CDT 2016


Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
---

jsstr_alloc_buf does not initialize ret in case of failure.

 dlls/jscript/jsstr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/jscript/jsstr.c b/dlls/jscript/jsstr.c
index add0195..8d27385 100644
--- a/dlls/jscript/jsstr.c
+++ b/dlls/jscript/jsstr.c
@@ -85,7 +85,7 @@ WCHAR *jsstr_alloc_buf(unsigned len, jsstr_t **r)
 
 jsstr_t *jsstr_alloc_len(const WCHAR *buf, unsigned len)
 {
-    jsstr_t *ret;
+    jsstr_t *ret = NULL;
     WCHAR *ptr;
 
     ptr = jsstr_alloc_buf(len, &ret);
-- 
2.9.0



More information about the wine-patches mailing list