Add empty pointer check in error cleanup
If realloc fails, the curargv will be NULL. Closes #253
This commit is contained in:
parent
d1e820d8ee
commit
e30c96ebde
@ -895,11 +895,12 @@ int redisvFormatCommand(char **target, const char *format, va_list ap) {
|
||||
return totlen;
|
||||
|
||||
err:
|
||||
if (curargv) {
|
||||
while(argc--)
|
||||
sdsfree(curargv[argc]);
|
||||
free(curargv);
|
||||
}
|
||||
|
||||
if (curarg != NULL)
|
||||
sdsfree(curarg);
|
||||
|
||||
/* No need to check cmd since it is the last statement that can fail,
|
||||
|
Loading…
Reference in New Issue
Block a user