flashrom.c: Replace 'exit(1)' leaks with return codes on err paths

Do not just exit in the middle of the process, rather return
a value back up to the caller to allow proper resource cleanup's
to occur.

flashrom-stable:
* Dropped change to extract_param() because it can't return errors

Change-Id: Ie4186a40071e9a7296d601582ff15ad7df09c70a
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/69474
Original-Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72365
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
1 file changed