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

@ -5,6 +5,7 @@
#include <strings.h>
#include <unistd.h>
#include <wlr/util/log.h>
#include "common/mem.h"
#include "config/mousebind.h"
#include "config/rcxml.h"
@ -108,7 +109,7 @@ mousebind_create(const char *context)
wlr_log(WLR_ERROR, "mousebind context not specified");
return NULL;
}
struct mousebind *m = calloc(1, sizeof(struct mousebind));
struct mousebind *m = xzalloc(sizeof(struct mousebind));
m->context = context_from_str(context);
if (m->context != LAB_SSD_NONE) {
wl_list_insert(rc.mousebinds.prev, &m->link);