diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-15 18:03:59 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-15 19:01:41 -0500 |
commit | 8cef81d6f23adb66873ee5fd84aa7180b22624f2 (patch) | |
tree | 0739dff1b879b5a674dbd56e44ad4f4a44e941c7 /sway/extensions.c | |
parent | Handle config-related allocation failures (diff) | |
download | sway-8cef81d6f23adb66873ee5fd84aa7180b22624f2.tar.gz sway-8cef81d6f23adb66873ee5fd84aa7180b22624f2.tar.zst sway-8cef81d6f23adb66873ee5fd84aa7180b22624f2.zip |
Handle some more memory allocation failures
Diffstat (limited to 'sway/extensions.c')
-rw-r--r-- | sway/extensions.c | 4 |
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 | |||
81 | } | 81 | } |
82 | sway_log(L_DEBUG, "Setting surface %p as background for output %d", surface, (int)output); | 82 | sway_log(L_DEBUG, "Setting surface %p as background for output %d", surface, (int)output); |
83 | struct background_config *config = malloc(sizeof(struct background_config)); | 83 | struct background_config *config = malloc(sizeof(struct background_config)); |
84 | if (!config) { | ||
85 | sway_log(L_ERROR, "Unable to allocate background config"); | ||
86 | return; | ||
87 | } | ||
84 | config->client = client; | 88 | config->client = client; |
85 | config->output = output; | 89 | config->output = output; |
86 | config->surface = wlc_resource_from_wl_surface_resource(surface); | 90 | config->surface = wlc_resource_from_wl_surface_resource(surface); |