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
e012bd58
Commit
e012bd58
authored
May 06, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
May 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Avoid leaking the previous environment in RtlSetCurrentEnvironment().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d98b87a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
env.c
dlls/ntdll/env.c
+8
-1
No files found.
dlls/ntdll/env.c
View file @
e012bd58
...
...
@@ -996,14 +996,21 @@ NTSTATUS WINAPI RtlQueryEnvironmentVariable_U(PWSTR env,
*/
void
WINAPI
RtlSetCurrentEnvironment
(
PWSTR
new_env
,
PWSTR
*
old_env
)
{
WCHAR
*
prev
;
TRACE
(
"(%p %p)
\n
"
,
new_env
,
old_env
);
RtlAcquirePebLock
();
if
(
old_env
)
*
old_en
v
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
Environment
;
pre
v
=
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
Environment
;
NtCurrentTeb
()
->
Peb
->
ProcessParameters
->
Environment
=
new_env
;
RtlReleasePebLock
();
if
(
old_env
)
*
old_env
=
prev
;
else
RtlDestroyEnvironment
(
prev
);
}
...
...
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