diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-15 18:26:53 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-15 19:01:41 -0500 |
commit | 10c8b73075fa0dd5512cc14be7240ec47f68dece (patch) | |
tree | e8835ef640d1d21ce0f36a5b1bcee726d926e55e /sway/config.c | |
parent | Add remaining sway allocation failure handling (diff) | |
download | sway-10c8b73075fa0dd5512cc14be7240ec47f68dece.tar.gz sway-10c8b73075fa0dd5512cc14be7240ec47f68dece.tar.zst sway-10c8b73075fa0dd5512cc14be7240ec47f68dece.zip |
Handle calloc failures
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c index b86bacdb..4164cefa 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -494,6 +494,9 @@ bool load_main_config(const char *file, bool is_active) { | |||
494 | 494 | ||
495 | struct sway_config *old_config = config; | 495 | struct sway_config *old_config = config; |
496 | config = calloc(1, sizeof(struct sway_config)); | 496 | config = calloc(1, sizeof(struct sway_config)); |
497 | if (!config) { | ||
498 | sway_abort("Unable to allocate config"); | ||
499 | } | ||
497 | 500 | ||
498 | config_defaults(config); | 501 | config_defaults(config); |
499 | if (is_active) { | 502 | if (is_active) { |