@henningw commented on this pull request.

I was not in the office for some time, so just had a quick look. Could you 
quickly check the memory allocation noted in the diff, just to be sure that its 
correct? Thank you.

> +             }
+
+               if(db_redis_authenticate(sentinel_con, sc.password) != 0) {
+                       LM_ERR("Authentication error\n");
+                       goto err;
+               }
+               reply = redisCommand(sentinel_con,
+                               "SENTINEL get-master-addr-by-name %s", 
db_redis_master_name);
+               if(!reply) {
+                       LM_ERR("Failed to run SENTINEL 
get-master-addr-by-name.\n");
+                       goto err;
+               }
+               // The reply should be an array with two elements: the master 
IP and port.
+               if(reply->type == REDIS_REPLY_ARRAY && reply->elements == 2) {
+                       if(con->id->host)
+                               pkg_free(con->id->host);

Is this actually allocated as as dedicated segment?

> @@ -374,6 +456,8 @@ int db_redis_connect(km_redis_con_t *con)
                redisFree(con->con);
                con->con = NULL;
        }
+       if(sentinel_con)

If its correct to allocate new memory for con->id->host, we should probably 
also release it here in error cases.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4373#pullrequestreview-3200856611
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/pull/4373/review/3200856...@github.com>
_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to