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
b24ee3b5
Commit
b24ee3b5
authored
Aug 18, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Use new() for allocations returning BadAlloc exception.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
eba92fd3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
lock.c
dlls/msvcrt/lock.c
+4
-10
No files found.
dlls/msvcrt/lock.c
View file @
b24ee3b5
...
...
@@ -23,7 +23,6 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "wine/heap.h"
#include "msvcrt.h"
#include "cppexcept.h"
#include "mtdll.h"
...
...
@@ -921,11 +920,9 @@ int __cdecl event_wait_for_multiple(event **events, size_t count, bool wait_all,
if
(
count
==
0
)
return
0
;
wait
=
heap_alloc
(
FIELD_OFFSET
(
thread_wait
,
entries
[
count
]));
if
(
!
wait
)
throw_exception
(
EXCEPTION_BAD_ALLOC
,
0
,
"bad allocation"
);
wait
=
operator_new
(
FIELD_OFFSET
(
thread_wait
,
entries
[
count
]));
ret
=
evt_wait
(
wait
,
events
,
count
,
wait_all
,
timeout
);
heap_fre
e
(
wait
);
operator_delet
e
(
wait
);
return
ret
;
}
...
...
@@ -1005,10 +1002,7 @@ bool __thiscall _Condition_variable_wait_for(_Condition_variable *this,
TRACE
(
"(%p %p %d)
\n
"
,
this
,
cs
,
timeout
);
if
(
!
(
q
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
cv_queue
))))
{
throw_exception
(
EXCEPTION_BAD_ALLOC
,
0
,
"bad allocation"
);
}
q
=
operator_new
(
sizeof
(
cv_queue
));
critical_section_lock
(
&
this
->
lock
);
q
->
next
=
this
->
queue
;
q
->
expired
=
FALSE
;
...
...
@@ -1030,7 +1024,7 @@ bool __thiscall _Condition_variable_wait_for(_Condition_variable *this,
NtWaitForKeyedEvent
(
keyed_event
,
q
,
0
,
0
);
}
HeapFree
(
GetProcessHeap
(),
0
,
q
);
operator_delete
(
q
);
critical_section_lock
(
cs
);
return
TRUE
;
}
...
...
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