summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-04-08 02:16:07 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-04-08 02:16:07 +0000
commit74f4ceb0cac90a7fc0cccda540e03cd19f42f47b (patch)
tree32bd1e50f45f03c9e4fab8cc1cb6b8ca2537591b
parentcf602fb21a23ac129837c269ef6d59011e7e675b (diff)
Plug memory leak when nitems == 0.
From NetBSD from Coverity CID 1752. OK jaredy@
-rw-r--r--usr.sbin/lpr/common_source/displayq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/lpr/common_source/displayq.c b/usr.sbin/lpr/common_source/displayq.c
index 04022f91c35..5e8b87245de 100644
--- a/usr.sbin/lpr/common_source/displayq.c
+++ b/usr.sbin/lpr/common_source/displayq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: displayq.c,v 1.26 2003/06/02 23:36:53 millert Exp $ */
+/* $OpenBSD: displayq.c,v 1.27 2006/04/08 02:16:06 ray Exp $ */
/* $NetBSD: displayq.c,v 1.21 2001/08/30 00:51:50 itojun Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static const char sccsid[] = "@(#)displayq.c 8.4 (Berkeley) 4/28/95";
#else
-static const char rcsid[] = "$OpenBSD: displayq.c,v 1.26 2003/06/02 23:36:53 millert Exp $";
+static const char rcsid[] = "$OpenBSD: displayq.c,v 1.27 2006/04/08 02:16:06 ray Exp $";
#endif
#endif /* not lint */
@@ -237,8 +237,8 @@ displayq(int format)
inform(q->q_name, rank++);
free(q);
}
- free(queue);
}
+ free(queue);
if (!remote) {
if (nitems == 0)
puts("no entries");