Merge pull request #6496 from oranagra/module_tests_valgrind

Make module tests pass with valgrind, and fix a leak in diskless load
This commit is contained in:
Salvatore Sanfilippo
2019-10-28 10:05:52 +01:00
committed by GitHub
4 changed files with 36 additions and 28 deletions

View File

@ -2172,7 +2172,11 @@ int rdbLoadRio(rio *rdb, rdbSaveInfo *rsi, int loading_aof) {
/* Read key */
if ((key = rdbLoadStringObject(rdb)) == NULL) goto eoferr;
/* Read value */
if ((val = rdbLoadObject(type,rdb,key)) == NULL) goto eoferr;
if ((val = rdbLoadObject(type,rdb,key)) == NULL) {
decrRefCount(key);
goto eoferr;
}
/* Check if the key already expired. This function is used when loading
* an RDB file from disk, either at startup, or when an RDB was
* received from the master. In the latter case, the master is