diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2019-10-28 10:05:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-28 10:05:52 +0100 |
commit | c328c807e7cef76db0fcf6fc2a58f62349489458 (patch) | |
tree | c6a76a5daecba3fef112aa3bab203d78f81388c4 /src | |
parent | d2658f83879e80574cb9541cdb50163da24d0782 (diff) | |
parent | be352633a07552d0c3893ffa096b3732347ea378 (diff) | |
download | redis-c328c807e7cef76db0fcf6fc2a58f62349489458.tar.gz |
Merge pull request #6496 from oranagra/module_tests_valgrind
Make module tests pass with valgrind, and fix a leak in diskless load
Diffstat (limited to 'src')
-rw-r--r-- | src/rdb.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 |