diff options
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 6 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/lpd.c | 6 | ||||
-rw-r--r-- | usr.sbin/lpr/lpd/printjob.c | 4 | ||||
-rw-r--r-- | usr.sbin/lpr/pac/pac.c | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 0ed7907fb96..3635ab3f129 100644 --- a/usr.sbin/lpr/common_source/common.c +++ b/usr.sbin/lpr/common_source/common.c @@ -1,4 +1,4 @@ -/* $OpenBSD: common.c,v 1.31 2007/03/16 20:03:48 stevesk Exp $ */ +/* $OpenBSD: common.c,v 1.32 2007/09/02 15:19:38 deraadt Exp $ */ /* $NetBSD: common.c,v 1.21 2000/08/09 14:28:50 itojun Exp $ */ /* @@ -39,7 +39,7 @@ #if 0 static const char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95"; #else -static const char rcsid[] = "$OpenBSD: common.c,v 1.31 2007/03/16 20:03:48 stevesk Exp $"; +static const char rcsid[] = "$OpenBSD: common.c,v 1.32 2007/09/02 15:19:38 deraadt Exp $"; #endif #endif /* not lint */ @@ -257,7 +257,7 @@ getq(struct queue ***namelist) * and dividing it by a multiple of the minimum size entry. */ arraysz = (stbuf.st_size / 24); - queue = (struct queue **)malloc(arraysz * sizeof(struct queue *)); + queue = (struct queue **)calloc(arraysz, sizeof(struct queue *)); if (queue == NULL) goto errdone; diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c index 915dbe21bdc..cbe84139a91 100644 --- a/usr.sbin/lpr/lpd/lpd.c +++ b/usr.sbin/lpr/lpd/lpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpd.c,v 1.46 2007/05/05 17:13:01 stevesk Exp $ */ +/* $OpenBSD: lpd.c,v 1.47 2007/09/02 15:19:38 deraadt Exp $ */ /* $NetBSD: lpd.c,v 1.33 2002/01/21 14:42:29 wiz Exp $ */ /* @@ -41,7 +41,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)lpd.c 8.7 (Berkeley) 5/10/95"; #else -static const char rcsid[] = "$OpenBSD: lpd.c,v 1.46 2007/05/05 17:13:01 stevesk Exp $"; +static const char rcsid[] = "$OpenBSD: lpd.c,v 1.47 2007/09/02 15:19:38 deraadt Exp $"; #endif #endif /* not lint */ @@ -794,7 +794,7 @@ socksetup(int af, int options, const char *port) for (r = res; r; r = r->ai_next, maxs++) ; if (socks == NULL) { - socks = malloc((maxs + 1) * sizeof(int)); + socks = calloc(maxs + 1, sizeof(int)); if (socks) *socks = 0; /* num of sockets ctr at start */ } else { diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c index 3348672aeeb..37ef6d775f9 100644 --- a/usr.sbin/lpr/lpd/printjob.c +++ b/usr.sbin/lpr/lpd/printjob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printjob.c,v 1.42 2007/04/07 21:57:27 stevesk Exp $ */ +/* $OpenBSD: printjob.c,v 1.43 2007/09/02 15:19:38 deraadt Exp $ */ /* $NetBSD: printjob.c,v 1.31 2002/01/21 14:42:30 wiz Exp $ */ /* @@ -1564,7 +1564,7 @@ setty(void) syslog(LOG_INFO, "%s: ioctl(TIOCGWINSZ): %m", printer); - argv = (char **)malloc(256 * sizeof(char *)); + argv = (char **)calloc(256, sizeof(char *)); if (argv == NULL) { syslog(LOG_ERR, "%s: malloc: %m", printer); exit(1); diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c index 60d9d237f34..894699eef0b 100644 --- a/usr.sbin/lpr/pac/pac.c +++ b/usr.sbin/lpr/pac/pac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pac.c,v 1.17 2003/06/02 23:36:53 millert Exp $ */ +/* $OpenBSD: pac.c,v 1.18 2007/09/02 15:19:39 deraadt Exp $ */ /* $NetBSD: pac.c,v 1.14 2000/04/27 13:40:18 msaitoh Exp $ */ /* @@ -41,7 +41,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)pac.c 8.1 (Berkeley) 6/6/93"; #else -static const char rcsid[] = "$OpenBSD: pac.c,v 1.17 2003/06/02 23:36:53 millert Exp $"; +static const char rcsid[] = "$OpenBSD: pac.c,v 1.18 2007/09/02 15:19:39 deraadt Exp $"; #endif #endif /* not lint */ @@ -286,7 +286,7 @@ dumpit(void) hp = hashtab[0]; hno = 1; - base = (struct hent **) malloc(hcount * sizeof(hp)); + base = (struct hent **) calloc(hcount, sizeof(hp)); if (base == NULL) err(1, NULL); for (ap = base, c = hcount; c--; ap++) { |