Commit 50df20b9 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

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

release_vbscode doesn't do anything if ref is 0.
parent faa68dab
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment