mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-06 14:43:20 +00:00
src/io/SDL_asyncio.c:SDL_AsyncIOFromFile(): Fix null-dereference warning
This commit is contained in:
parent
8bfde6755e
commit
ad11c6988c
1 changed files with 8 additions and 6 deletions
|
|
@ -57,12 +57,14 @@ SDL_AsyncIO *SDL_AsyncIOFromFile(const char *file, const char *mode)
|
|||
}
|
||||
|
||||
SDL_AsyncIO *asyncio = (SDL_AsyncIO *)SDL_calloc(1, sizeof(*asyncio));
|
||||
if (asyncio) {
|
||||
asyncio->lock = SDL_CreateMutex();
|
||||
if (!asyncio->lock) {
|
||||
SDL_free(asyncio);
|
||||
return NULL;
|
||||
}
|
||||
if (!asyncio) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
asyncio->lock = SDL_CreateMutex();
|
||||
if (!asyncio->lock) {
|
||||
SDL_free(asyncio);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!SDL_SYS_AsyncIOFromFile(file, binary_mode, asyncio)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue