Added guard for some object inits to prevent memory leak by misuse (#662)

Co-authored-by: Nik Schewtschuk <nikonlinee@gmail.com>
This commit is contained in:
NikSchew
2024-06-02 13:42:47 +02:00
committed by GitHub
parent 4a7b7763c2
commit 7276bf471d
4 changed files with 12 additions and 4 deletions
+3 -1
View File
@@ -1279,5 +1279,7 @@ void Analog_Output_Cleanup(void)
*/
void Analog_Output_Init(void)
{
Object_List = Keylist_Create();
if (!Object_List) {
Object_List = Keylist_Create();
}
}
+3 -1
View File
@@ -1554,5 +1554,7 @@ void Binary_Lighting_Output_Cleanup(void)
*/
void Binary_Lighting_Output_Init(void)
{
Object_List = Keylist_Create();
if (!Object_List) {
Object_List = Keylist_Create();
}
}
+3 -1
View File
@@ -1231,5 +1231,7 @@ bool Binary_Output_Delete(uint32_t object_instance)
*/
void Binary_Output_Init(void)
{
Object_List = Keylist_Create();
if (!Object_List) {
Object_List = Keylist_Create();
}
}
+3 -1
View File
@@ -1006,5 +1006,7 @@ bool Binary_Value_Delete(uint32_t object_instance)
*/
void Binary_Value_Init(void)
{
Object_List = Keylist_Create();
if (!Object_List) {
Object_List = Keylist_Create();
}
}