From: Andrew Donnellan Date: Wed, 4 May 2016 01:22:57 +0000 (+1000) Subject: lib/flash: fix resource leak in flash_setup_buffer() error paths X-Git-Tag: v1.1.0~4 X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=87fa4885310b6c6b79e31d79d192ba9ea90cf236;hp=87fa4885310b6c6b79e31d79d192ba9ea90cf236;p=petitboot lib/flash: fix resource leak in flash_setup_buffer() error paths Some error paths in flash_setup_buffer() fail to free the flash_info struct or close the open ffs before they return. Change them to goto the cleanup code at the end. Separate the cleanup code into separate labels depending on whether we need to call ffs_close(), arch_flash_close() and talloc_free(). Signed-off-by: Andrew Donnellan Signed-off-by: Samuel Mendoza-Jonas ---