Fixed memory leak when out of memory
parent
ffbad3617c
commit
bac8df4abd
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue