vbscript: Fix memory leak on error path in alloc_vbscode (scan-build).

release_vbscode doesn't do anything if ref is 0.
This commit is contained in:
Alex Henrie 2023-06-06 23:52:16 -06:00 committed by Alexandre Julliard
parent faa68dabc3
commit 50df20b9ec

View file

@ -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;