Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/lpr/pac PR/50666: David Binderman:



details:   https://anonhg.NetBSD.org/src/rev/7685ba054110
branches:  trunk
changeset: 813132:7685ba054110
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Jan 17 14:50:31 2016 +0000

description:
PR/50666: David Binderman:
He's out of jail and out of bail and that's the way it goes:
    free(base);

diffstat:

 usr.sbin/lpr/pac/pac.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 05a20f9b71f8 -r 7685ba054110 usr.sbin/lpr/pac/pac.c
--- a/usr.sbin/lpr/pac/pac.c    Sun Jan 17 14:46:07 2016 +0000
+++ b/usr.sbin/lpr/pac/pac.c    Sun Jan 17 14:50:31 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pac.c,v 1.23 2011/08/30 19:27:37 joerg Exp $   */
+/*     $NetBSD: pac.c,v 1.24 2016/01/17 14:50:31 christos Exp $        */
 
 /*
  * Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)pac.c      8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: pac.c,v 1.23 2011/08/30 19:27:37 joerg Exp $");
+__RCSID("$NetBSD: pac.c,v 1.24 2016/01/17 14:50:31 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -255,7 +255,7 @@
 
        hp = hashtab[0];
        hno = 1;
-       base = (struct hent **) calloc(sizeof hp, hcount);
+       base = calloc(sizeof hp, hcount);
        if (base == NULL)
                err(1, "calloc");
        for (ap = base, c = hcount; c--; ap++) {
@@ -284,6 +284,7 @@
                printf("Sum:%7.2f %4d $%7.2f\n", feet, runs, 
                        feet * price * runs);
        }
+       free(base);
 }
 
 /*



Home | Main Index | Thread Index | Old Index