futility: updater: Fix failure by modifying released memory

When deleting the temp files, the pointer to released head must not be
used again. Setting 'next' to NULL should be done earlier.

BUG=chromium:1055468
TEST=make clean && make runfutiltests
BRANCH=none

Change-Id: Ia4356ade5fcf85e2bfc917c5a3bcbb7f492c5a08
Signed-off-by: Hung-Te Lin <hungte@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2071179
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
1 file changed