aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSevz <leohdz172@protonmail.com>2022-03-11 18:40:45 -0600
committerGitHub <noreply@github.com>2022-03-11 18:40:45 -0600
commitc49a42ee580888f922cd21eb884271e2fa64f063 (patch)
treea7fd44f849dbcf0e52643e9163f7305e08fc06f3
parent05a473335ea4c69569d9ad34298b4f42a555e6e3 (diff)
parentb0098d9d095509e4999965d261fe4282040a187a (diff)
Merge pull request #196 from noocsharp/main
die on allocation failure
-rw-r--r--dwl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index ba150fa..9991c95 100644
--- a/dwl.c
+++ b/dwl.c
@@ -779,6 +779,8 @@ createkeyboard(struct wlr_input_device *device)
struct xkb_context *context;
struct xkb_keymap *keymap;
Keyboard *kb = device->data = calloc(1, sizeof(*kb));
+ if (!kb)
+ EBARF("createkeyboard: calloc");
kb->device = device;
/* Prepare an XKB keymap and assign it to the keyboard. */
@@ -810,6 +812,8 @@ createmon(struct wl_listener *listener, void *data)
struct wlr_output *wlr_output = data;
const MonitorRule *r;
Monitor *m = wlr_output->data = calloc(1, sizeof(*m));
+ if (!m)
+ EBARF("createmon: calloc");
m->wlr_output = wlr_output;
wlr_output_init_render(wlr_output, alloc, drw);
@@ -893,6 +897,8 @@ createnotify(struct wl_listener *listener, void *data)
/* Allocate a Client for this surface */
c = xdg_surface->data = calloc(1, sizeof(*c));
+ if (!c)
+ EBARF("createnotify: calloc");
c->surface.xdg = xdg_surface;
c->bw = borderpx;
@@ -919,6 +925,8 @@ createlayersurface(struct wl_listener *listener, void *data)
}
layersurface = calloc(1, sizeof(LayerSurface));
+ if (!layersurface)
+ EBARF("layersurface: calloc");
LISTEN(&wlr_layer_surface->surface->events.commit,
&layersurface->surface_commit, commitlayersurfacenotify);
LISTEN(&wlr_layer_surface->events.destroy, &layersurface->destroy,
@@ -2483,6 +2491,8 @@ createnotifyx11(struct wl_listener *listener, void *data)
/* Allocate a Client for this surface */
c = xwayland_surface->data = calloc(1, sizeof(*c));
+ if (!c)
+ EBARF("createnotifyx11: calloc");
c->surface.xwayland = xwayland_surface;
c->type = xwayland_surface->override_redirect ? X11Unmanaged : X11Managed;
c->bw = borderpx;