Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
368124e8
Commit
368124e8
authored
Sep 21, 2017
by
zhaozhao.zz
Committed by
antirez
Sep 21, 2017
Browse files
Lazyfree: avoid memory leak when free slowlog entry
parent
79567b6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/slowlog.c
View file @
368124e8
...
@@ -72,9 +72,12 @@ slowlogEntry *slowlogCreateEntry(client *c, robj **argv, int argc, long long dur
...
@@ -72,9 +72,12 @@ slowlogEntry *slowlogCreateEntry(client *c, robj **argv, int argc, long long dur
(
unsigned
long
)
(
unsigned
long
)
sdslen
(
argv
[
j
]
->
ptr
)
-
SLOWLOG_ENTRY_MAX_STRING
);
sdslen
(
argv
[
j
]
->
ptr
)
-
SLOWLOG_ENTRY_MAX_STRING
);
se
->
argv
[
j
]
=
createObject
(
OBJ_STRING
,
s
);
se
->
argv
[
j
]
=
createObject
(
OBJ_STRING
,
s
);
}
else
{
}
else
if
(
argv
[
j
]
->
refcount
==
OBJ_SHARED_REFCOUNT
)
{
se
->
argv
[
j
]
=
argv
[
j
];
se
->
argv
[
j
]
=
argv
[
j
];
incrRefCount
(
argv
[
j
]);
}
else
{
/* Duplicate a string object,
* avoid memory leak for lazyfree. */
se
->
argv
[
j
]
=
dupStringObject
(
argv
[
j
]);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment