From: otto Date: Mon, 18 Dec 2023 13:23:52 +0000 (+0000) Subject: Check if calloc calls succeeded; ok millert@ X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5f231c1e4e35f39a1a30796044ba61b9e8c79833;p=openbsd Check if calloc calls succeeded; ok millert@ --- diff --git a/sbin/dump/main.c b/sbin/dump/main.c index 75133ff42ca..b23c408cd96 100644 --- a/sbin/dump/main.c +++ b/sbin/dump/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.63 2022/06/02 15:35:55 millert Exp $ */ +/* $OpenBSD: main.c,v 1.64 2023/12/18 13:23:52 otto Exp $ */ /* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */ /*- @@ -465,6 +465,9 @@ main(int argc, char *argv[]) usedinomap = calloc((unsigned) mapsize, sizeof(char)); dumpdirmap = calloc((unsigned) mapsize, sizeof(char)); dumpinomap = calloc((unsigned) mapsize, sizeof(char)); + if (usedinomap == NULL || dumpdirmap == NULL || dumpinomap == NULL) + quit("Failed to allocate tables"); + tapesize = 3 * (howmany(mapsize * sizeof(char), TP_BSIZE) + 1); nonodump = spcl.c_level < honorlevel;