From 51c1d40d0854ae2677c26ed039d01f5ce0f129a3 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 6 Jul 2016 19:12:24 +0200 Subject: [PATCH] redis_check_rdb(): the rio structure must be global. The rio structure is referenced in the global 'riostate' structure in order for the logging functions to be always able to access the state of the "pseudo-loading" of the RDB, needed for the check. Courtesy of Valgrind. --- src/redis-check-rdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis-check-rdb.c b/src/redis-check-rdb.c index 53fb67b8..08be40f6 100644 --- a/src/redis-check-rdb.c +++ b/src/redis-check-rdb.c @@ -180,7 +180,7 @@ int redis_check_rdb(char *rdbfilename) { char buf[1024]; long long expiretime, now = mstime(); FILE *fp; - rio rdb; + static rio rdb; /* Pointed by global struct riostate. */ if ((fp = fopen(rdbfilename,"r")) == NULL) return 1;