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

@ -2,8 +2,10 @@
#include <string.h>
#include <strings.h>
#include "common/mem.h"
#include "config/libinput.h"
#include "config/rcxml.h"
static void
libinput_category_init(struct libinput_category *l)
{
@ -36,10 +38,7 @@ get_device_type(const char *s)
struct libinput_category *
libinput_category_create(void)
{
struct libinput_category *l = calloc(1, sizeof(struct libinput_category));
if (!l) {
return NULL;
}
struct libinput_category *l = xzalloc(sizeof(struct libinput_category));
libinput_category_init(l);
wl_list_insert(&rc.libinput_categories, &l->link);
return l;