Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bb80eaa4
Commit
bb80eaa4
authored
Sep 12, 2011
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Don't leak memory in parser.
parent
5b8cde66
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
parse.h
dlls/vbscript/parse.h
+3
-0
parser.y
dlls/vbscript/parser.y
+8
-2
No files found.
dlls/vbscript/parse.h
View file @
bb80eaa4
...
...
@@ -87,8 +87,11 @@ typedef struct {
statement_t
*
stats
;
statement_t
*
stats_tail
;
vbsheap_t
heap
;
}
parser_ctx_t
;
HRESULT
parse_script
(
parser_ctx_t
*
,
const
WCHAR
*
)
DECLSPEC_HIDDEN
;
void
parser_release
(
parser_ctx_t
*
)
DECLSPEC_HIDDEN
;
int
parser_lex
(
void
*
,
parser_ctx_t
*
)
DECLSPEC_HIDDEN
;
void
*
parser_alloc
(
parser_ctx_t
*
,
size_t
)
DECLSPEC_HIDDEN
;
dlls/vbscript/parser.y
View file @
bb80eaa4
...
...
@@ -280,8 +280,7 @@ void *parser_alloc(parser_ctx_t *ctx, size_t size)
{
void *ret;
/* FIXME: leaks! */
ret = heap_alloc(size);
ret = vbsheap_alloc(&ctx->heap, size);
if(!ret)
ctx->hres = E_OUTOFMEMORY;
return ret;
...
...
@@ -292,6 +291,8 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
ctx->code = ctx->ptr = code;
ctx->end = ctx->code + strlenW(ctx->code);
vbsheap_init(&ctx->heap);
ctx->parse_complete = FALSE;
ctx->hres = S_OK;
...
...
@@ -311,3 +312,8 @@ HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code)
return S_OK;
}
void parser_release(parser_ctx_t *ctx)
{
vbsheap_free(&ctx->heap);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment