Check for failure in allocations.

This commit is contained in:
Hisham
2016-02-02 15:53:02 +01:00
parent a1f7f2869e
commit b54d2dde40
42 changed files with 141 additions and 134 deletions

View File

@ -106,7 +106,7 @@ ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) {
Panel_setHeader(super, "Colors");
for (int i = 0; ColorSchemeNames[i] != NULL; i++) {
Panel_add(super, (Object*) CheckItem_newByVal(strdup(ColorSchemeNames[i]), false));
Panel_add(super, (Object*) CheckItem_newByVal(xStrdup(ColorSchemeNames[i]), false));
}
CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true);
return this;