Stop pac dereferencing a null pointer if accounting is not enabeled.

PR:		24798 18191
Submitted by:	Nick Hilliard <nick@netability.ie>
Reviewed by:	gad
This commit is contained in:
dwmalone 2001-02-25 13:50:29 +00:00
parent 1ab8876e4a
commit 69c64365e5

View File

@ -450,7 +450,8 @@ chkprinter(s)
case PCAPERR_TCLOOP:
fatal(pp, "%s", pcaperr(stat));
}
acctfile = pp->acct_file;
if ((acctfile = pp->acct_file) == NULL)
errx(3, "accounting not enabled for printer %s", s);
if (!pflag && pp->price100)
price = pp->price100/10000.0;
sumfile = (char *) calloc(sizeof(char), strlen(acctfile)+5);