Don't pass a negative value to __redisAsyncCommand if redisFormatSdsCommandArgv fails

This commit is contained in:
Frederik Deweerdt 2017-05-15 09:19:21 -07:00
parent 97cd8157f7
commit 706129a161

View File

@ -676,6 +676,8 @@ int redisAsyncCommandArgv(redisAsyncContext *ac, redisCallbackFn *fn, void *priv
int len; int len;
int status; int status;
len = redisFormatSdsCommandArgv(&cmd,argc,argv,argvlen); len = redisFormatSdsCommandArgv(&cmd,argc,argv,argvlen);
if (len < 0)
return REDIS_ERR;
status = __redisAsyncCommand(ac,fn,privdata,cmd,len); status = __redisAsyncCommand(ac,fn,privdata,cmd,len);
sdsfree(cmd); sdsfree(cmd);
return status; return status;