Fix potential memory leak when creating config items fails

This commit is contained in:
Maschell
2022-09-18 22:05:44 +02:00
parent bf8d300588
commit 7b9868bd0e
5 changed files with 6 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ extern "C" bool WUPSConfigItemIntegerRange_AddToCategory(WUPSConfigCategoryHandl
};
if (WUPSConfigCategory_AddItem(cat, item->handle) < 0) {
WUPSConfigItem_Destroy(item->handle);
return false;
}
return true;