Handle allocation failures in `reftable_calloc()`. Signed-off-by: Patrick Steinhardt <ps@xxxxxx> --- reftable/basics.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reftable/basics.c b/reftable/basics.c index 4adc98cf5de..b404900b5d9 100644 --- a/reftable/basics.c +++ b/reftable/basics.c @@ -39,6 +39,8 @@ void *reftable_calloc(size_t nelem, size_t elsize) { size_t sz = st_mult(nelem, elsize); void *p = reftable_malloc(sz); + if (!p) + return NULL; memset(p, 0, sz); return p; } -- 2.46.0.551.gc5ee8f2d1c.dirty