dedupe: fix warning and segfault on -B0
authorJens Axboe <axboe@fb.com>
Fri, 26 Sep 2014 16:16:53 +0000 (10:16 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 26 Sep 2014 16:16:53 +0000 (10:16 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
t/dedupe.c

index 3ae17242f4a741bf2ccefd818f4fc8aeea3e6bc4..37437c2c4e970825ae61c7f0378503a6f7040879 100644 (file)
@@ -508,7 +508,7 @@ static int usage(char *argv[])
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
-       uint64_t nextents, nchunks;
+       uint64_t nextents = 0, nchunks = 0;
        int c, ret;
 
        debug_init();
        int c, ret;
 
        debug_init();
@@ -564,7 +564,8 @@ int main(int argc, char *argv[])
        show_stat(nextents, nchunks);
 
        fio_mutex_remove(rb_lock);
        show_stat(nextents, nchunks);
 
        fio_mutex_remove(rb_lock);
-       bloom_free(bloom);
+       if (bloom)
+               bloom_free(bloom);
        scleanup();
        return ret;
 }
        scleanup();
        return ret;
 }