]> git.ozlabs.org Git - petitboot/commitdiff
lib/flash: fix resource leak in flash_setup_buffer() error paths
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Wed, 4 May 2016 01:22:57 +0000 (11:22 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Fri, 6 May 2016 03:57:30 +0000 (13:57 +1000)
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 <andrew.donnellan@au1.ibm.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>

No differences found