From bac8df4abdccd82f4409bae1fe2ae4d3a6f74055 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 28 Aug 2022 17:55:49 -0700 Subject: [PATCH] Fixed memory leak when out of memory --- src/joystick/linux/SDL_sysjoystick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index b95d6f0c4..e96e5b0aa 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -331,6 +331,7 @@ MaybeAddDevice(const char *path) item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item)); if (item == NULL) { + SDL_free(name); return -1; }