mirror of
https://github.com/RPCS3/hidapi.git
synced 2026-07-21 08:56:07 -04:00
[PR #13] [CLOSED] hid.c: Fix reinitialization after an error #12
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RPCS3/hidapi/pull/13
Author: @elad335
Created: 4/3/2024
Status: ❌ Closed
Base:
master← Head:master📝 Commits (1)
ef7be3chid.c: Fix reinitialization after an error📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
linux/hid.c(+2 -2)📄 Description
This should fix the crashes I experienced whenever DuelSense and DuelShock 4 got disconnected from bluetooth, either by battery shortage or manual shutdown from the controller.
The bug occured because data from the stack was used instead of dynamic memory to output the error after device connection errors, upon reinitialization (in an attempt to reconnect with the controller) the function got called again to clean the error buffer, but it called the C function
freewith an invalid pointer.The crash occured inside of the
freefunction.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.