aboutsummaryrefslogtreecommitdiff
path: root/sway/extensions.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-12-15 18:03:59 -0500
committerDrew DeVault <sir@cmpwn.com>2016-12-15 19:01:41 -0500
commit8cef81d6f23adb66873ee5fd84aa7180b22624f2 (patch)
tree0739dff1b879b5a674dbd56e44ad4f4a44e941c7 /sway/extensions.c
parentd75a747a3ddc99f258025a923de1cf4821bf3115 (diff)
Handle some more memory allocation 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 96c7e60d..759cbb84 100644
--- a/sway/extensions.c
+++ b/sway/extensions.c
@@ -81,6 +81,10 @@ static void set_background(struct wl_client *client, struct wl_resource *resourc
}
sway_log(L_DEBUG, "Setting surface %p as background for output %d", surface, (int)output);
struct background_config *config = malloc(sizeof(struct background_config));
+ if (!config) {
+ sway_log(L_ERROR, "Unable to allocate background config");
+ return;
+ }
config->client = client;
config->output = output;
config->surface = wlc_resource_from_wl_surface_resource(surface);