[PATCH v2 5/8] dinput: Return E_OUTOFMEMORY on allocation failure in hid_joystick_create_device().

Rémi Bernon rbernon at codeweavers.com
Mon May 16 04:50:42 CDT 2022


From: Zebediah Figura <zfigura at codeweavers.com>

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/dinput/joystick_hid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c
index ddd67be4fd0..171ef4e2640 100644
--- a/dlls/dinput/joystick_hid.c
+++ b/dlls/dinput/joystick_hid.c
@@ -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;
-- 
2.35.1




More information about the wine-devel mailing list