mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:40:48 +00:00
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:
parent
faa68dabc3
commit
50df20b9ec
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue