Merge pull request #215 from charliesome/fix-bugs
Fix a couple of bugs uncovered by the Clang static analyzer
This commit is contained in:
commit
065e90557c
7
async.c
7
async.c
@ -174,6 +174,11 @@ redisAsyncContext *redisAsyncConnectUnix(const char *path) {
|
||||
return NULL;
|
||||
|
||||
ac = redisAsyncInitialize(c);
|
||||
if (ac == NULL) {
|
||||
redisFree(c);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
__redisAsyncCopyError(ac);
|
||||
return ac;
|
||||
}
|
||||
@ -398,7 +403,7 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
|
||||
__redisAsyncDisconnect(ac);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* If monitor mode, repush callback */
|
||||
if(c->flags & REDIS_MONITORING) {
|
||||
__redisPushCallback(&ac->replies,&cb);
|
||||
|
6
sds.c
6
sds.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user