diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-03 23:13:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-07-03 23:13:03 +0000 |
commit | 6a37eefb47356c0634d3a6a25b3a9bfed0318260 (patch) | |
tree | 208ded78f7ae05212a1ce5f5864104024c348345 /usr.bin/bdes | |
parent | c78ac1aed8538984e5fcc1c8a2d3b7ff2135c265 (diff) |
check for malloc failure; reported by cloder@acm.org
Diffstat (limited to 'usr.bin/bdes')
-rw-r--r-- | usr.bin/bdes/bdes.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/bdes/bdes.c b/usr.bin/bdes/bdes.c index d9edde50ac0..b5eeed4e8e6 100644 --- a/usr.bin/bdes/bdes.c +++ b/usr.bin/bdes/bdes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bdes.c,v 1.7 2002/02/16 21:27:44 millert Exp $ */ +/* $OpenBSD: bdes.c,v 1.8 2002/07/03 23:13:02 deraadt Exp $ */ /* $NetBSD: bdes.c,v 1.2 1995/03/26 03:33:19 glass Exp $ */ /*- @@ -51,7 +51,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)bdes.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: bdes.c,v 1.7 2002/02/16 21:27:44 millert Exp $"; +static char rcsid[] = "$OpenBSD: bdes.c,v 1.8 2002/07/03 23:13:02 deraadt Exp $"; #endif #endif /* not lint */ @@ -205,6 +205,8 @@ main(ac, av) argc = ac; ac = 1; argv = malloc((argc + 1) * sizeof(char *)); + if (argv == NULL) + errx(1, "out of memory"); for (i = 0; i < argc; ++i) { argv[i] = strdup(av[i]); MEMZERO(av[i], strlen(av[i])); |