Handle calloc failures

This commit is contained in:
Drew DeVault 2016-12-15 18:26:53 -05:00
parent a2b9149656
commit 10c8b73075
8 changed files with 39 additions and 2 deletions

View file

@ -494,6 +494,9 @@ bool load_main_config(const char *file, bool is_active) {
struct sway_config *old_config = config;
config = calloc(1, sizeof(struct sway_config));
if (!config) {
sway_abort("Unable to allocate config");
}
config_defaults(config);
if (is_active) {