mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-07 18:39:37 +01:00
Fix memory leak in ConnectSensor
'name' is leaked in case of error.
This commit is contained in:
parent
557aa140e8
commit
844d5e3ed3
@ -294,6 +294,7 @@ static int ConnectSensor(ISensor *sensor)
|
|||||||
new_sensors = (SDL_Windows_Sensor *)SDL_realloc(SDL_sensors, (SDL_num_sensors + 1) * sizeof(SDL_Windows_Sensor));
|
new_sensors = (SDL_Windows_Sensor *)SDL_realloc(SDL_sensors, (SDL_num_sensors + 1) * sizeof(SDL_Windows_Sensor));
|
||||||
if (new_sensors == NULL) {
|
if (new_sensors == NULL) {
|
||||||
SDL_UnlockSensors();
|
SDL_UnlockSensors();
|
||||||
|
SDL_free(name);
|
||||||
return SDL_OutOfMemory();
|
return SDL_OutOfMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user