diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-30 23:58:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-10-30 23:58:53 +0000 |
commit | f8b684c52c0f80d842183ab3cef669babadfcab3 (patch) | |
tree | a8d40e12012a1fcc8b65225f7ba2e72576425bae /sbin | |
parent | 4e9425d9fb8cd1a4b976d6cd80a993398626f69f (diff) |
malloc failures in init? never. but try to be reasonable for one dumb one
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/init/init.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index 76ba0da20a1..8fc3e13f700 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.33 2003/07/29 18:38:36 deraadt Exp $ */ +/* $OpenBSD: init.c,v 1.34 2003/10/30 23:58:52 deraadt Exp $ */ /* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.33 2003/07/29 18:38:36 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.34 2003/10/30 23:58:52 deraadt Exp $"; #endif #endif /* not lint */ @@ -918,12 +918,16 @@ setupargv(session_t *sp, struct ttyent *typ) if (sp->se_window) free(sp->se_window); sp->se_window = strdup(typ->ty_window); + if (sp->se_window == NULL) { + warning("can't allocate window"); + return (0); + } sp->se_window_argv = construct_argv(sp->se_window); - if (sp->se_window_argv == 0) { + if (sp->se_window_argv == NULL) { warning("can't parse window for port %s", sp->se_device); free(sp->se_window); - sp->se_window = 0; + sp->se_window = NULL; return (0); } } |