]> git.tue.mpg.de Git - paraslash.git/commitdiff
fsck.c: Fix NULL-pointer dereference.
authorAndre Noll <maan@systemlinux.org>
Sat, 22 Dec 2007 12:58:01 +0000 (13:58 +0100)
committerAndre Noll <maan@systemlinux.org>
Sat, 22 Dec 2007 12:58:01 +0000 (13:58 +0100)
fsck_cleanup() might be called with t == NULL.

fsck.c

diff --git a/fsck.c b/fsck.c
index bbacdf26e9a39ad5cfdb7b785b73e01aff9ea1de..6d5078c7ea0fa6cdcf5b137acbb31fd06bac6b54 100644 (file)
--- 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);
 
 }