diff options
author | Oran Agra <oran@redislabs.com> | 2019-10-24 09:45:25 +0300 |
---|---|---|
committer | Oran Agra <oran@redislabs.com> | 2019-10-24 09:45:25 +0300 |
commit | be352633a07552d0c3893ffa096b3732347ea378 (patch) | |
tree | 07a1bd1a060291b5105f7ca2f2e2f5f0f5fec5f8 /src/rdb.c | |
parent | 673c9d702962a5618650108eaf4c5f38bcafe164 (diff) | |
download | redis-be352633a07552d0c3893ffa096b3732347ea378.tar.gz |
Make module tests pass with valgrind, and fix a leak in diskless load
Diffstat (limited to 'src/rdb.c')
-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 |