Really make sure we initialize hash if it hasn't been initialized yet
authorJonathan Dieter <jdieter@gmail.com>
Mon, 3 Dec 2018 20:40:44 +0000 (20:40 +0000)
committerJonathan Dieter <jdieter@gmail.com>
Mon, 3 Dec 2018 20:40:44 +0000 (20:40 +0000)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/comp/comp.c

index cd2363415aaed2e5823df4533ac0b22e6fb97d6e..da0cfe138789b1bedaad3ada40c5a8aac10a88a5 100644 (file)
@@ -507,7 +507,7 @@ ssize_t comp_read(zckCtx *zck, char *dst, size_t dst_size, bool use_dict) {
             zck_log(ZCK_LOG_DDEBUG, "EOF");
             finished_rd = true;
         }
-        if(&(zck->check_chunk_hash) == NULL)
+        if(zck->check_chunk_hash.ctx == NULL)
             if(!hash_init(zck, &(zck->check_chunk_hash),
                           &(zck->chunk_hash_type)))
                 goto hash_error;