Skip to content

Commit 6e3dd57

Browse files
authored
Return from hid_open_path early in case if hid_init fails to avoid crash (#555)
Fixes: #547
1 parent 5f5072f commit 6e3dd57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mac/hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
10261026

10271027
/* Set up the HID Manager if it hasn't been done */
10281028
if (hid_init() < 0) {
1029-
goto return_error;
1029+
return NULL;
10301030
}
10311031
/* register_global_error: global error is set/reset by hid_init */
10321032

0 commit comments

Comments
 (0)