Skip to content

Commit

Permalink
Fix memory leak in ConnectSensor
Browse files Browse the repository at this point in the history
'name' is leaked in case of error.
  • Loading branch information
meyraud705 authored and slouken committed Feb 22, 2021
1 parent 557aa14 commit 844d5e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sensor/windows/SDL_windowssensor.c
Expand Up @@ -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));
if (new_sensors == NULL) {
SDL_UnlockSensors();
SDL_free(name);
return SDL_OutOfMemory();
}

Expand Down

0 comments on commit 844d5e3

Please sign in to comment.