In pc98_write if we encounter an error we can return without
freeing s0.

Signed-off-by: Will Newton <[email protected]>
---
 libparted/labels/pc98.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libparted/labels/pc98.c b/libparted/labels/pc98.c
index b2ce591..f18642f 100644
--- a/libparted/labels/pc98.c
+++ b/libparted/labels/pc98.c
@@ -456,8 +456,10 @@ pc98_write (const PedDisk* disk)
                if (!part)
                        continue;
 
-               if (!fill_raw_part (&table->partitions [i - 1], part))
+               if (!fill_raw_part (&table->partitions [i - 1], part)) {
+                       free (s0);
                        return 0;
+               }
        }
 
        int write_ok = ped_device_write (disk->dev, table, 0, 2);
-- 
2.9.4


Reply via email to