examples: assert on memory allocation

Also checks for NULL output in the `X_from_device` functions
This commit is contained in:
Simon Zeni 2024-04-08 10:11:50 -04:00
parent ebef710746
commit 7cb206deb4
11 changed files with 39 additions and 1 deletions

View file

@ -1,3 +1,4 @@
#include <assert.h>
#include <getopt.h>
#include <stdbool.h>
#include <stdio.h>
@ -154,6 +155,7 @@ static void server_handle_new_output(struct wl_listener *listener, void *data) {
wlr_output_init_render(wlr_output, server->allocator, server->renderer);
struct fullscreen_output *output = calloc(1, sizeof(*output));
assert(output);
output->wlr_output = wlr_output;
output->server = server;
output->frame.notify = output_handle_frame;