mirror of
https://github.com/encounter/SDL.git
synced 2025-05-19 13:51:27 +00:00
Fixed bug 5167 - Memory leak in GuessXInputDevice
meyraud705 Variable 'devices' is not freed if function GuessXInputDevice, in SDL_xinputjoystick.c, return early.
This commit is contained in:
parent
06267f5028
commit
ac1f174ad5
@ -155,6 +155,7 @@ GuessXInputDevice(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion)
|
|||||||
*pVID = (Uint16)rdi.hid.dwVendorId;
|
*pVID = (Uint16)rdi.hid.dwVendorId;
|
||||||
*pPID = (Uint16)rdi.hid.dwProductId;
|
*pPID = (Uint16)rdi.hid.dwProductId;
|
||||||
*pVersion = (Uint16)rdi.hid.dwVersionNumber;
|
*pVersion = (Uint16)rdi.hid.dwVersionNumber;
|
||||||
|
SDL_free(devices);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -201,6 +202,7 @@ GuessXInputDevice(Uint8 userid, Uint16 *pVID, Uint16 *pPID, Uint16 *pVersion)
|
|||||||
SDL_free(s_arrXInputDevicePath[userid]);
|
SDL_free(s_arrXInputDevicePath[userid]);
|
||||||
}
|
}
|
||||||
s_arrXInputDevicePath[userid] = SDL_strdup(devName);
|
s_arrXInputDevicePath[userid] = SDL_strdup(devName);
|
||||||
|
SDL_free(devices);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user