audit_proc_coredump: check return value of audit_new

audit_new may return NULL if audit is disabled or suspended.

Sponsored by:	HybridCluster
MFC after:	7 days
This commit is contained in:
avg 2013-07-09 09:03:01 +00:00
parent 44c288e149
commit f4ecb1058b

View File

@ -701,6 +701,8 @@ audit_proc_coredump(struct thread *td, char *path, int errcode)
* (signal) tokens.
*/
ar = audit_new(AUE_CORE, td);
if (ar == NULL)
return;
if (path != NULL) {
pathp = &ar->k_ar.ar_arg_upath1;
*pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK);