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
e30c96eb
Commit
e30c96eb
authored
Jul 14, 2014
by
NanXiao
Committed by
Matt Stancliff
Jan 05, 2015
Browse files
Add empty pointer check in error cleanup
If realloc fails, the curargv will be NULL. Closes #253
parent
d1e820d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
hiredis.c
View file @
e30c96eb
...
...
@@ -895,12 +895,13 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
return
totlen
;
err:
while
(
argc
--
)
sdsfree
(
curargv
[
argc
]);
free
(
curargv
);
if
(
curargv
)
{
while
(
argc
--
)
sdsfree
(
curargv
[
argc
]);
free
(
curargv
);
}
if
(
curarg
!=
NULL
)
sdsfree
(
curarg
);
sdsfree
(
curarg
);
/* No need to check cmd since it is the last statement that can fail,
* but do it anyway to be as defensive as possible. */
...
...
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