mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Fix rdb.c dictionary iterator release in 2 more places.
This commit is contained in:
parent
cd87b3c71f
commit
b85aae78df
10
src/rdb.c
10
src/rdb.c
@ -772,7 +772,10 @@ ssize_t rdbSaveObject(rio *rdb, robj *o) {
|
||||
dictIterator *di = dictGetIterator(set);
|
||||
dictEntry *de;
|
||||
|
||||
if ((n = rdbSaveLen(rdb,dictSize(set))) == -1) return -1;
|
||||
if ((n = rdbSaveLen(rdb,dictSize(set))) == -1) {
|
||||
dictReleaseIterator(di);
|
||||
return -1;
|
||||
}
|
||||
nwritten += n;
|
||||
|
||||
while((de = dictNext(di)) != NULL) {
|
||||
@ -842,7 +845,10 @@ ssize_t rdbSaveObject(rio *rdb, robj *o) {
|
||||
dictIterator *di = dictGetIterator(o->ptr);
|
||||
dictEntry *de;
|
||||
|
||||
if ((n = rdbSaveLen(rdb,dictSize((dict*)o->ptr))) == -1) return -1;
|
||||
if ((n = rdbSaveLen(rdb,dictSize((dict*)o->ptr))) == -1) {
|
||||
dictReleaseIterator(di);
|
||||
return -1;
|
||||
}
|
||||
nwritten += n;
|
||||
|
||||
while((de = dictNext(di)) != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user