summaryrefslogtreecommitdiff
path: root/sway/extensions.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2016-12-15 18:26:53 -0500
committerDrew DeVault <[email protected]>2016-12-15 19:01:41 -0500
commit10c8b73075fa0dd5512cc14be7240ec47f68dece (patch)
treee8835ef640d1d21ce0f36a5b1bcee726d926e55e /sway/extensions.c
parenta2b914965686bb4352b8ebc4a46d898f5a793647 (diff)
Handle calloc failures
Diffstat (limited to 'sway/extensions.c')
-rw-r--r--sway/extensions.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/extensions.c b/sway/extensions.c
index 759cbb84..40702e28 100644
--- a/sway/extensions.c
+++ b/sway/extensions.c
@@ -23,6 +23,10 @@ static struct panel_config *find_or_create_panel_config(struct wl_resource *reso
}
sway_log(L_DEBUG, "Creating panel config for resource %p", resource);
struct panel_config *config = calloc(1, sizeof(struct panel_config));
+ if (!config) {
+ sway_log(L_ERROR, "Unable to create panel config");
+ return NULL;
+ }
list_add(desktop_shell.panels, config);
config->wl_resource = resource;
return config;