Alex Henrie : vbscript: Fix memory leak on error path in alloc_vbscode (scan-build).
Module: wine Branch: master Commit: 50df20b9ece2c6cd8e8c43f29ce1b51121590ae2 URL: https://gitlab.winehq.org/wine/wine/-/commit/50df20b9ece2c6cd8e8c43f29ce1b51... Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Tue Jun 6 23:52:16 2023 -0600 vbscript: Fix memory leak on error path in alloc_vbscode (scan-build). release_vbscode doesn't do anything if ref is 0. --- dlls/vbscript/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/vbscript/compile.c b/dlls/vbscript/compile.c index 1012f6af469..f86ecfded91 100644 --- a/dlls/vbscript/compile.c +++ b/dlls/vbscript/compile.c @@ -1951,6 +1951,7 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source, DWORD_P memcpy(ret->source, source, len * sizeof(WCHAR)); ret->source[len] = 0; + ret->ref = 1; ret->cookie = cookie; ret->start_line = start_line; @@ -1966,7 +1967,6 @@ static vbscode_t *alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source, DWORD_P ret->main_code.type = FUNC_GLOBAL; ret->main_code.code_ctx = ret; - ret->ref = 1; list_init(&ret->entry); return ret;
participants (1)
-
Alexandre Julliard