util: use zalloc in stringbuf

zalloc() aborts on allocation failure and it's what we use everywhere
else.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1465>
This commit is contained in:
Peter Hutterer 2026-04-14 07:24:28 +10:00 committed by Marge Bot
parent 2ea3fb1d13
commit 5f29257569

View file

@ -41,7 +41,7 @@ stringbuf_init(struct stringbuf *b)
{
b->len = 0;
b->sz = 64;
b->data = calloc(1, b->sz);
b->data = zalloc(b->sz);
}
static inline bool
@ -62,7 +62,7 @@ stringbuf_reset(struct stringbuf *b)
static inline struct stringbuf *
stringbuf_new(void)
{
struct stringbuf *b = calloc(1, sizeof(*b));
struct stringbuf *b = zalloc(sizeof(*b));
stringbuf_init(b);
return b;
}