crash: Clean up the temp file used in GetLogContents.

On R63, some big log dumps can fill up /tmp and make the OS unstable.

R64 won't be affected since it introduces sandboxing and unmounts
its own /tmp each time. That said, this CL is still safe for ToT (R64)
and needs to land and be baked on R64 before cherry-picked to R63.

BUG=chromium:789052
TEST=/tmp is not filled up after repeated crashes.
TEST=cros_run_unit_tests --packages crash-reporter

Change-Id: I0a54fdac9a150cc37d50f72f6095babb79528bd5
Reviewed-on: https://chromium-review.googlesource.com/798550
Commit-Ready: Kazuhiro Inaba <kinaba@chromium.org>
Tested-by: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
(cherry picked from commit 7244202cb543ec33fa1e6b3908d05dc30d33d1a8)
Reviewed-on: https://chromium-review.googlesource.com/802835
Trybot-Ready: Kazuhiro Inaba <kinaba@chromium.org>
Reviewed-by: Kazuhiro Inaba <kinaba@chromium.org>
Commit-Queue: Kazuhiro Inaba <kinaba@chromium.org>
1 file changed