Module: kamailio
Branch: master
Commit: 89495b8595d37f4d24e10e5ed1177614b2979d82
URL:
https://github.com/kamailio/kamailio/commit/89495b8595d37f4d24e10e5ed117761…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-04-28T14:09:13+02:00
db_redis: free db vals on error
---
Modified: src/modules/db_redis/redis_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/89495b8595d37f4d24e10e5ed117761…
Patch:
https://github.com/kamailio/kamailio/commit/89495b8595d37f4d24e10e5ed117761…
---
diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c
index 68536816a8..254e0f6b3e 100644
--- a/src/modules/db_redis/redis_dbase.c
+++ b/src/modules/db_redis/redis_dbase.c
@@ -2164,6 +2164,8 @@ static int db_redis_perform_update(const db1_con_t* _h,
km_redis_con_t *con, con
if (db_redis_build_type_keys(con, CON_TABLE(_h), db_keys, db_vals,
all_type_keys_count,
&type_keys, &set_keys, &type_keys_count) != 0) {
LM_ERR("failed to build type keys\n");
+ pkg_free(db_vals);
+ db_vals = NULL;
goto error;
}
pkg_free(db_keys);
@@ -2306,7 +2308,7 @@ static int db_redis_perform_update(const db1_con_t* _h,
km_redis_con_t *con, con
if (scard != 0)
continue;
-
+
if (db_redis_key_add_string(&query_v, "SREM", 4) != 0) {
LM_ERR("Failed to add srem command to post-delete
query\n");
goto error;