Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e2ae9e3c
Commit
e2ae9e3c
authored
Jul 07, 2017
by
Hugh McMaster
Committed by
Alexandre Julliard
Jul 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
regedit: Use a function to free the parser data.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6f244266
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
24 deletions
+15
-24
regproc.c
programs/regedit/regproc.c
+15
-24
No files found.
programs/regedit/regproc.c
View file @
e2ae9e3c
...
@@ -495,6 +495,15 @@ static LONG open_key(struct parser *parser, WCHAR *path)
...
@@ -495,6 +495,15 @@ static LONG open_key(struct parser *parser, WCHAR *path)
return
res
;
return
res
;
}
}
static
void
free_parser_data
(
struct
parser
*
parser
)
{
if
(
parser
->
parse_type
==
REG_DWORD
||
parser
->
parse_type
==
REG_BINARY
)
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
parser
->
data
=
NULL
;
parser
->
data_size
=
0
;
}
enum
reg_versions
{
enum
reg_versions
{
REG_VERSION_31
,
REG_VERSION_31
,
REG_VERSION_40
,
REG_VERSION_40
,
...
@@ -802,9 +811,7 @@ static WCHAR *string_data_state(struct parser *parser, WCHAR *pos)
...
@@ -802,9 +811,7 @@ static WCHAR *string_data_state(struct parser *parser, WCHAR *pos)
return
line
;
return
line
;
invalid:
invalid:
parser
->
data
=
NULL
;
free_parser_data
(
parser
);
parser
->
data_size
=
0
;
set_state
(
parser
,
LINE_START
);
set_state
(
parser
,
LINE_START
);
return
line
;
return
line
;
}
}
...
@@ -826,10 +833,7 @@ static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos)
...
@@ -826,10 +833,7 @@ static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos)
return
line
;
return
line
;
invalid:
invalid:
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
free_parser_data
(
parser
);
parser
->
data
=
NULL
;
parser
->
data_size
=
0
;
set_state
(
parser
,
LINE_START
);
set_state
(
parser
,
LINE_START
);
return
line
;
return
line
;
}
}
...
@@ -870,10 +874,7 @@ static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos)
...
@@ -870,10 +874,7 @@ static WCHAR *hex_data_state(struct parser *parser, WCHAR *pos)
return
line
;
return
line
;
invalid:
invalid:
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
free_parser_data
(
parser
);
parser
->
data
=
NULL
;
parser
->
data_size
=
0
;
set_state
(
parser
,
LINE_START
);
set_state
(
parser
,
LINE_START
);
return
line
;
return
line
;
}
}
...
@@ -890,10 +891,7 @@ static WCHAR *eol_backslash_state(struct parser *parser, WCHAR *pos)
...
@@ -890,10 +891,7 @@ static WCHAR *eol_backslash_state(struct parser *parser, WCHAR *pos)
return
pos
;
return
pos
;
invalid:
invalid:
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
free_parser_data
(
parser
);
parser
->
data
=
NULL
;
parser
->
data_size
=
0
;
set_state
(
parser
,
LINE_START
);
set_state
(
parser
,
LINE_START
);
return
p
;
return
p
;
}
}
...
@@ -918,10 +916,7 @@ static WCHAR *hex_multiline_state(struct parser *parser, WCHAR *pos)
...
@@ -918,10 +916,7 @@ static WCHAR *hex_multiline_state(struct parser *parser, WCHAR *pos)
return
line
;
return
line
;
invalid:
invalid:
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
free_parser_data
(
parser
);
parser
->
data
=
NULL
;
parser
->
data_size
=
0
;
set_state
(
parser
,
LINE_START
);
set_state
(
parser
,
LINE_START
);
return
line
;
return
line
;
}
}
...
@@ -941,11 +936,7 @@ static WCHAR *set_value_state(struct parser *parser, WCHAR *pos)
...
@@ -941,11 +936,7 @@ static WCHAR *set_value_state(struct parser *parser, WCHAR *pos)
RegSetValueExW
(
parser
->
hkey
,
parser
->
value_name
,
0
,
parser
->
data_type
,
RegSetValueExW
(
parser
->
hkey
,
parser
->
value_name
,
0
,
parser
->
data_type
,
parser
->
data
,
parser
->
data_size
);
parser
->
data
,
parser
->
data_size
);
if
(
parser
->
parse_type
==
REG_DWORD
||
parser
->
parse_type
==
REG_BINARY
)
free_parser_data
(
parser
);
HeapFree
(
GetProcessHeap
(),
0
,
parser
->
data
);
parser
->
data
=
NULL
;
parser
->
data_size
=
0
;
if
(
parser
->
reg_version
==
REG_VERSION_31
)
if
(
parser
->
reg_version
==
REG_VERSION_31
)
set_state
(
parser
,
PARSE_WIN31_LINE
);
set_state
(
parser
,
PARSE_WIN31_LINE
);
...
...
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