freebsd32_getrusage(2): skip freebsd32_rusage_out on error

PR:		230153
Reported by:	kib
MFC after:	2 weeks
X-MFC-With:	336871
Differential Revision:	https://reviews.freebsd.org/D16500
This commit is contained in:
asomers 2018-07-29 19:20:13 +00:00
parent f537dbc2c9
commit 0bdfcd97cb

View File

@ -883,9 +883,10 @@ freebsd32_getrusage(struct thread *td, struct freebsd32_getrusage_args *uap)
int error;
error = kern_getrusage(td, uap->who, &s);
freebsd32_rusage_out(&s, &s32);
if (error == 0)
if (error == 0) {
freebsd32_rusage_out(&s, &s32);
error = copyout(&s32, uap->rusage, sizeof(s32));
}
return (error);
}