common: Add additional memory utilities (xzalloc() etc.)

This commit is contained in:
John Lindgren 2022-09-16 18:41:02 -04:00
parent b89f7bfc0d
commit cb40cdc36c
35 changed files with 193 additions and 167 deletions

View file

@ -7,6 +7,7 @@
* - keeping non-layer-shell xdg-popups outside the layers.c code
*/
#include "common/mem.h"
#include "labwc.h"
#include "node.h"
@ -67,10 +68,7 @@ xdg_popup_create(struct view *view, struct wlr_xdg_popup *wlr_popup)
return;
}
struct xdg_popup *popup = calloc(1, sizeof(struct xdg_popup));
if (!popup) {
return;
}
struct xdg_popup *popup = xzalloc(sizeof(struct xdg_popup));
popup->parent_view = view;
popup->wlr_popup = wlr_popup;