On 2015/08/26 12:22, Chao Fan wrote:
sph will be freed twice when it meet below conditions:

             sph->signature1 != SADUMP_SIGNATURE1 ||
             sph->signature2 != SADUMP_SIGNATURE2

Then it will be freed once and goto error: to free again. So remove the
1st free.

Signed-off-by: Chao Fan <[email protected]>
---
  sadump_info.c | 1 -
  1 file changed, 1 deletion(-)

diff --git a/sadump_info.c b/sadump_info.c
index e8154f4..1474fb2 100644
--- a/sadump_info.c
+++ b/sadump_info.c
@@ -695,7 +695,6 @@ read_sadump_header_diskset(int diskid, struct 
sadump_diskset_info *sdi)
        if (sph->signature1 != SADUMP_SIGNATURE1 ||
            sph->signature2 != SADUMP_SIGNATURE2) {
                DEBUG_MSG("sadump: does not have partition header\n");
-               free(sph);
                goto error;
        }



Thanks! It looks good to me.

Acked-by: HATAYAMA Daisuke <[email protected]>

--
Thanks.
HATAYAMA, Daisuke


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to