Fix memory leak in mvccRestore
Former-commit-id: 165333b0fc648c79e66f04d9c8c4a1d0059fe57a
This commit is contained in:
parent
651abfdca0
commit
aa47e643b0
@ -48,8 +48,8 @@ endif
|
|||||||
USEASM?=true
|
USEASM?=true
|
||||||
|
|
||||||
ifneq ($(strip $(SANITIZE)),)
|
ifneq ($(strip $(SANITIZE)),)
|
||||||
CFLAGS+= -fsanitize=$(SANITIZE) -DSANITIZE
|
CFLAGS+= -fsanitize=$(SANITIZE) -DSANITIZE -fno-omit-frame-pointer
|
||||||
CXXFLAGS+= -fsanitize=$(SANITIZE) -DSANITIZE
|
CXXFLAGS+= -fsanitize=$(SANITIZE) -DSANITIZE -fno-omit-frame-pointer
|
||||||
LDFLAGS+= -fsanitize=$(SANITIZE)
|
LDFLAGS+= -fsanitize=$(SANITIZE)
|
||||||
MALLOC=libc
|
MALLOC=libc
|
||||||
USEASM=false
|
USEASM=false
|
||||||
|
@ -5066,12 +5066,15 @@ void mvccrestoreCommand(client *c) {
|
|||||||
setMvccTstamp(obj, mvcc);
|
setMvccTstamp(obj, mvcc);
|
||||||
|
|
||||||
/* Create the key and set the TTL if any */
|
/* Create the key and set the TTL if any */
|
||||||
dbMerge(c->db,key,obj,true);
|
if (dbMerge(c->db,key,obj,true)) {
|
||||||
if (expire >= 0) {
|
if (expire >= 0) {
|
||||||
setExpire(c,c->db,key,nullptr,expire);
|
setExpire(c,c->db,key,nullptr,expire);
|
||||||
|
}
|
||||||
|
signalModifiedKey(c,c->db,key);
|
||||||
|
notifyKeyspaceEvent(NOTIFY_GENERIC,"restore",key,c->db->id);
|
||||||
|
} else {
|
||||||
|
decrRefCount(obj);
|
||||||
}
|
}
|
||||||
signalModifiedKey(c,c->db,key);
|
|
||||||
notifyKeyspaceEvent(NOTIFY_GENERIC,"restore",key,c->db->id);
|
|
||||||
addReply(c,shared.ok);
|
addReply(c,shared.ok);
|
||||||
g_pserver->dirty++;
|
g_pserver->dirty++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user