diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-04-25 20:07:10 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-04-25 20:07:10 +0000 |
commit | e294f1e17d0e66df5e6f777424a6fa89f3dd1a63 (patch) | |
tree | 1ee310fde6f677d6f3151193815430dba5ad415a /usr.bin/newsyslog | |
parent | 14f6abdffc727eeddbcea128909598e7ffd9dfaa (diff) |
check asprintf return value for error, as the pointer is not guaranteed
to be NULL in such case; ok millert
Diffstat (limited to 'usr.bin/newsyslog')
-rw-r--r-- | usr.bin/newsyslog/newsyslog.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c index 975020fd5b6..ca8c5daae52 100644 --- a/usr.bin/newsyslog/newsyslog.c +++ b/usr.bin/newsyslog/newsyslog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newsyslog.c,v 1.63 2003/02/12 19:17:36 millert Exp $ */ +/* $OpenBSD: newsyslog.c,v 1.64 2003/04/25 20:07:09 pvalchev Exp $ */ /* * Copyright (c) 1999, 2002, 2003 Todd C. Miller <Todd.Miller@courtesan.com> @@ -86,7 +86,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: newsyslog.c,v 1.63 2003/02/12 19:17:36 millert Exp $"; +static const char rcsid[] = "$OpenBSD: newsyslog.c,v 1.64 2003/04/25 20:07:09 pvalchev Exp $"; #endif /* not lint */ #ifndef CONF @@ -1079,8 +1079,7 @@ openmail(void) FILE *ret; char *cmdbuf = NULL; - asprintf(&cmdbuf, "%s -t", SENDMAIL); - if (cmdbuf) { + if (asprintf(&cmdbuf, "%s -t", SENDMAIL) != -1) { ret = popen(cmdbuf, "w"); free(cmdbuf); return (ret); |