Module: kamailio
Branch: master
Commit: 2033a368ebbec4bb9928f4bceebb47b7eeb84ac2
URL: 
https://github.com/kamailio/kamailio/commit/2033a368ebbec4bb9928f4bceebb47b7eeb84ac2

Author: Donat Zenichev <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-01-06T12:44:27+01:00

db_redis: use `db_redis_key_add_str()` where possible

No sense to use `db_redis_key_add_string()`,
if there is `str` object and not the char array.

---

Modified: src/modules/db_redis/redis_dbase.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/2033a368ebbec4bb9928f4bceebb47b7eeb84ac2.diff
Patch: 
https://github.com/kamailio/kamailio/commit/2033a368ebbec4bb9928f4bceebb47b7eeb84ac2.patch

---

diff --git a/src/modules/db_redis/redis_dbase.c 
b/src/modules/db_redis/redis_dbase.c
index cefed0150cd..3e778c52660 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -884,7 +884,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t 
*con,
                                        goto err;
                                }
                        }
-                       if(db_redis_key_add_string(&query_v, index_key->s, 
index_key->len)
+                       if(db_redis_key_add_str(&query_v, index_key)
                                        != 0) {
                                LM_ERR("Failed to add scan command to scan 
query\n");
                                goto err;
@@ -899,8 +899,7 @@ static int db_redis_scan_query_keys_pattern(km_redis_con_t 
*con,
                        LM_ERR("Failed to add match command to scan query\n");
                        goto err;
                }
-               if(db_redis_key_add_string(
-                                  &query_v, match_pattern->s, 
match_pattern->len)
+               if(db_redis_key_add_str(&query_v, match_pattern)
                                != 0) {
                        LM_ERR("Failed to add match pattern to scan query\n");
                        goto err;

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to