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
fa2c0582
Commit
fa2c0582
authored
Sep 21, 2017
by
Salvatore Sanfilippo
Committed by
GitHub
Sep 21, 2017
Browse files
Merge pull request #4324 from soloestoy/lazyfree-fix-memory-leak
Lazyfree: avoid memory leak when free slowlog entry
parents
bb3b5ddd
269760ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/slowlog.c
View file @
fa2c0582
...
@@ -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