mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 08:56:25 +00:00
Fix uninitialised variable 'properties'
If SDL_CreateHashTable() fails, properties->lock is not initialised, SDL_FreeProperties() is called and destroys the uninitialised lock.
This commit is contained in:

committed by
Sam Lantinga

parent
e54c5e0204
commit
dfb87e1099
@@ -119,7 +119,7 @@ SDL_PropertiesID SDL_CreateProperties(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
properties = SDL_malloc(sizeof(*properties));
|
properties = SDL_calloc(1, sizeof(*properties));
|
||||||
if (!properties) {
|
if (!properties) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user