From dfb87e1099668ce3b4dd504c5105ae207f030cea Mon Sep 17 00:00:00 2001
From: Mathieu Eyraud <[EMAIL REDACTED]>
Date: Fri, 10 Nov 2023 11:54:21 +0100
Subject: [PATCH] Fix uninitialised variable 'properties'
If SDL_CreateHashTable() fails, properties->lock is not initialised, SDL_FreeProperties() is called and destroys the uninitialised lock.
---
src/SDL_properties.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/SDL_properties.c b/src/SDL_properties.c
index 31da31d32043..de54ee8c3009 100644
--- a/src/SDL_properties.c
+++ b/src/SDL_properties.c
@@ -119,7 +119,7 @@ SDL_PropertiesID SDL_CreateProperties(void)
return 0;
}
- properties = SDL_malloc(sizeof(*properties));
+ properties = SDL_calloc(1, sizeof(*properties));
if (!properties) {
goto error;
}