Fix bug in detecting failure to allocate zckCtx
authorJonathan Dieter <jdieter@gmail.com>
Sun, 11 Mar 2018 08:54:39 +0000 (10:54 +0200)
committerJonathan Dieter <jdieter@gmail.com>
Sun, 11 Mar 2018 08:54:39 +0000 (10:54 +0200)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
src/lib/zck.c

index 0f76f308e5d56b400a1f78ba83d07e185a5833cb..feadbf38a60127777181574ceb1ef8dc7a1aa204 100644 (file)
@@ -85,7 +85,7 @@ void zck_free(zckCtx *zck) {
 
 zckCtx *zck_create() {
     zckCtx *zck = zmalloc(sizeof(zckCtx));
-    if(zck->index.hash_type == NULL) {
+    if(zck == NULL) {
         zck_log(ZCK_LOG_ERROR, "Unable to allocate %lu bytes\n",
                 sizeof(zckCtx));
         return False;