Module: kamailio
Branch: master
Commit: c5681600a5fdd650a4830e77aca2b4804766ccfa
URL:
https://github.com/kamailio/kamailio/commit/c5681600a5fdd650a4830e77aca2b48…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-10-31T15:28:22+01:00
ndb_redis: get the srv structure after checking parameter sanity
---
Modified: modules/ndb_redis/redis_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c5681600a5fdd650a4830e77aca2b48…
Patch:
https://github.com/kamailio/kamailio/commit/c5681600a5fdd650a4830e77aca2b48…
---
diff --git a/modules/ndb_redis/redis_client.c b/modules/ndb_redis/redis_client.c
index dff2ef2..274c165 100644
--- a/modules/ndb_redis/redis_client.c
+++ b/modules/ndb_redis/redis_client.c
@@ -364,7 +364,6 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
va_start(ap, cmd);
va_copy(ap2, ap);
- rsrv = redisc_get_server(srv);
if(srv==NULL || cmd==NULL || res==NULL)
{
LM_ERR("invalid parameters");
@@ -375,6 +374,7 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
LM_ERR("invalid parameters");
goto error_exec;
}
+ rsrv = redisc_get_server(srv);
if(rsrv==NULL)
{
LM_ERR("no redis server found: %.*s\n", srv->len, srv->s);