From 2b6071b44587264cdaf6750e5f2fb6f7d65ecebe Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 8 Oct 2015 19:43:08 +0200 Subject: [PATCH] Bug fix: Double free if a boot image has no extents. Coverity CID 12598. --- libisofs/fs_image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libisofs/fs_image.c b/libisofs/fs_image.c index 4ea0c46..c080677 100644 --- a/libisofs/fs_image.c +++ b/libisofs/fs_image.c @@ -4860,8 +4860,10 @@ int iso_impsysa_reduce_next_above(IsoImage *image, uint32_t block, if (ret > 0 && section_count > 0) if (block != sections[0].block) iso_impsysa_reduce_na(block, next_above, sections[0].block); - if (sections != NULL) + if (sections != NULL) { free(sections); + sections = NULL; + } } iso_impsysa_reduce_na(block, next_above, sai->image_size);