diff options
Diffstat (limited to 'usr.sbin/lpr/common_source')
-rw-r--r-- | usr.sbin/lpr/common_source/common.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c index 10b293d75fb..bf764c81a43 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.35 2013/12/10 16:38:04 naddy Exp $ */ +/* $OpenBSD: common.c,v 1.36 2014/10/16 04:17:48 deraadt Exp $ */ /* $NetBSD: common.c,v 1.21 2000/08/09 14:28:50 itojun Exp $ */ /* @@ -270,15 +270,14 @@ getq(struct queue ***namelist) */ if (nitems == arraysz) { struct queue **newqueue; - size_t newarraysz = arraysz * 2; - newqueue = (struct queue **)realloc(queue, - newarraysz * sizeof(struct queue *)); + newqueue = reallocarray(queue, + arraysz, 2 * sizeof(struct queue *)); if (newqueue == NULL) { free(q); goto errdone; } + arraysz *= 2; queue = newqueue; - arraysz = newarraysz; } queue[nitems++] = q; } |