Merge branch 'fanalyzer-fix' into 'master'

GCC static analyzer misc fixes

See merge request wlroots/wlroots!4637
This commit is contained in:
Simon Zeni 2024-06-12 17:33:31 +00:00
commit 52730a2f1e
17 changed files with 57 additions and 6 deletions

View file

@ -250,6 +250,7 @@ static void server_new_keyboard(struct tinywl_server *server,
struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device);
struct tinywl_keyboard *keyboard = calloc(1, sizeof(*keyboard));
assert(keyboard);
keyboard->server = server;
keyboard->wlr_keyboard = wlr_keyboard;
@ -625,6 +626,7 @@ static void server_new_output(struct wl_listener *listener, void *data) {
/* Allocates and configures our state for this output */
struct tinywl_output *output = calloc(1, sizeof(*output));
assert(output);
output->wlr_output = wlr_output;
output->server = server;
@ -801,6 +803,7 @@ static void server_new_xdg_toplevel(struct wl_listener *listener, void *data) {
/* Allocate a tinywl_toplevel for this surface */
struct tinywl_toplevel *toplevel = calloc(1, sizeof(*toplevel));
assert(toplevel);
toplevel->server = server;
toplevel->xdg_toplevel = xdg_toplevel;
toplevel->scene_tree =
@ -859,6 +862,7 @@ static void server_new_xdg_popup(struct wl_listener *listener, void *data) {
struct wlr_xdg_popup *xdg_popup = data;
struct tinywl_popup *popup = calloc(1, sizeof(*popup));
assert(popup);
popup->xdg_popup = xdg_popup;
/* We must add xdg popups to the scene graph so they get rendered. The