dinput: Return E_OUTOFMEMORY on allocation failure in hid_joystick_create_device().

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-05-16 11:50:42 +02:00 committed by Alexandre Julliard
parent dd5f3b6fc1
commit ac7fa1677a
1 changed files with 1 additions and 0 deletions

View File

@ -2073,6 +2073,7 @@ HRESULT hid_joystick_create_device( struct dinput *dinput, const GUID *guid, IDi
impl->attrs = attrs;
list_init( &impl->effect_list );
hr = E_OUTOFMEMORY;
preparsed = (struct hid_preparsed_data *)impl->preparsed;
size = preparsed->input_caps_count * sizeof(struct object_properties);
if (!(object_properties = calloc( 1, size ))) goto failed;