Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
81c95a5f
Commit
81c95a5f
authored
Jan 15, 2014
by
Charlie Somerville
Browse files
sds.c: avoid leaking tokens when seplen < 1 || len < 0
parent
cc3ee453
Changes
1
Show whitespace changes
Inline
Side-by-side
sds.c
View file @
81c95a5f
...
...
@@ -295,7 +295,11 @@ sds *sdssplitlen(char *s, int len, char *sep, int seplen, int *count) {
#ifdef SDS_ABORT_ON_OOM
if
(
tokens
==
NULL
)
sdsOomAbort
();
#endif
if
(
seplen
<
1
||
len
<
0
||
tokens
==
NULL
)
return
NULL
;
if
(
tokens
==
NULL
)
return
NULL
;
if
(
seplen
<
1
||
len
<
0
)
{
free
(
tokens
);
return
NULL
;
}
if
(
len
==
0
)
{
*
count
=
0
;
return
tokens
;
...
...
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