mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-19 16:21:44 +00:00
Fixed memory leak when out of memory
This commit is contained in:
@@ -331,6 +331,7 @@ MaybeAddDevice(const char *path)
|
|||||||
|
|
||||||
item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item));
|
item = (SDL_joylist_item *) SDL_calloc(1, sizeof (SDL_joylist_item));
|
||||||
if (item == NULL) {
|
if (item == NULL) {
|
||||||
|
SDL_free(name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user