tdb2: fix uninitialized var.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 6 Oct 2010 17:10:03 +0000 (03:40 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 6 Oct 2010 17:10:03 +0000 (03:40 +1030)
ccan/tdb2/summary.c

index e7a291967cb034cda442b807ed563fc8c7c2b58e..e9f986e7727a4775928617256ed65e11e0dbaa5c 100644 (file)
@@ -163,6 +163,8 @@ char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags)
                *bucketsg[BUCKETS_FOR_ZONE(63)+1] = { NULL };
        char *ret = NULL;
 
+       zonesg = hashesg = freeg = keysg = datag = extrag = uncoalg = NULL;
+
        if (tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false) != 0)
                return NULL;
 
@@ -222,9 +224,6 @@ char *tdb_summary(struct tdb_context *tdb, enum tdb_summary_flags flags)
                                                      HISTO_WIDTH,
                                                      HISTO_HEIGHT);
                }
-       } else {
-               zonesg = hashesg = freeg = keysg = datag = extrag = uncoalg
-                       = NULL;
        }
 
        /* 20 is max length of a %llu. */