diff options
author | emersion <contact@emersion.fr> | 2017-10-07 13:09:55 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-10-07 16:22:03 +0200 |
commit | 4374c521353d1f3268b7bd6c7864223bc0eff3b3 (patch) | |
tree | 7131a308239c969528c028622e2be6d3bf2f1a2a | |
parent | ecd5263d4d0c243b9fecfd9b71c0afaa5991a8df (diff) |
Free screenshot state
-rw-r--r-- | types/wlr_screenshooter.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/types/wlr_screenshooter.c b/types/wlr_screenshooter.c index f2d0937b..b16c1ba9 100644 --- a/types/wlr_screenshooter.c +++ b/types/wlr_screenshooter.c @@ -43,7 +43,7 @@ static void output_frame_notify(struct wl_listener *listener, void *_data) { orbital_screenshot_send_done(state->screenshot->resource); - // TODO: free(state) + free(state); } static void screenshooter_shoot(struct wl_client *client, @@ -69,8 +69,10 @@ static void screenshooter_shoot(struct wl_client *client, return; } - struct wlr_screenshot *screenshot; - if (!(screenshot = calloc(1, sizeof(struct wlr_screenshot)))) { + struct wlr_screenshot *screenshot = + calloc(1, sizeof(struct wlr_screenshot)); + if (!screenshot) { + wl_client_post_no_memory(client); return; } screenshot->output = _output; |