diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c index 336211268408..1e4199d2a640 100644 --- a/sys/kern/kern_acct.c +++ b/sys/kern/kern_acct.c @@ -284,12 +284,7 @@ sys_acct(struct thread *td, struct acct_args *uap) error = kproc_create(acct_thread, NULL, NULL, 0, 0, "accounting"); if (error) { - (void) vn_close(acct_vp, acct_flags, acct_cred, td); - crfree(acct_cred); - acct_configured = 0; - acct_vp = NULL; - acct_cred = NULL; - acct_flags = 0; + (void) acct_disable(td, 0); sx_xunlock(&acct_sx); log(LOG_NOTICE, "Unable to start accounting thread\n"); return (error);