Don't do NULL-checks before free()

This commit is contained in:
Eddy Jansson
2025-10-19 11:17:11 +02:00
committed by Sam Lantinga
parent aaee09d6ed
commit 3b0347ac48
3 changed files with 8 additions and 11 deletions

View File

@@ -991,9 +991,7 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
break;
}
if (device_interface_list != NULL) {
free(device_interface_list);
}
free(device_interface_list); // This should NOT be SDL_free()
device_interface_list = (wchar_t*)calloc(len, sizeof(wchar_t));
if (device_interface_list == NULL) {