From 98b15c02668ea0ef84be6e04daa1838c206658a5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 22 Dec 2007 13:58:01 +0100 Subject: [PATCH] fsck.c: Fix NULL-pointer dereference. fsck_cleanup() might be called with t == NULL. --- fsck.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fsck.c b/fsck.c index bbacdf26..6d5078c7 100644 --- a/fsck.c +++ b/fsck.c @@ -621,6 +621,9 @@ out: static void fsck_cleanup(struct osl_table *t) { int i; + + if (!t) + return; if (t->desc->column_descriptions) { struct osl_column_description *cd; for (i = 0; i < t->desc->num_columns; i++) { @@ -629,10 +632,8 @@ static void fsck_cleanup(struct osl_table *t) } free(t->desc->column_descriptions); } - if (t) { - free(t->columns); - free(t); - } + free(t->columns); + free(t); } -- 2.39.5