- Added the check for NULL pointer. When TCP session to redis reset,
redisCommand function can return NULL pointer.
(cherry picked from commit c32a0be89cc92a0649277774d1e7aebf349b8b49)
... | ... |
@@ -1269,6 +1269,10 @@ int redisc_check_auth(redisc_server_t *rsrv, char *pass) |
1269 | 1269 |
int retval = 0; |
1270 | 1270 |
|
1271 | 1271 |
reply = redisCommand(rsrv->ctxRedis, "AUTH %s", pass); |
1272 |
+ if(!reply) { |
|
1273 |
+ LM_ERR("Redis authentication error\n"); |
|
1274 |
+ return -1; |
|
1275 |
+ } |
|
1272 | 1276 |
if (reply->type == REDIS_REPLY_ERROR) { |
1273 | 1277 |
LM_ERR("Redis authentication error\n"); |
1274 | 1278 |
retval = -1; |