Module: kamailio
Branch: master
Commit: 33228bba33a6ea2e2d9a7acd9a240929223b9d39
URL:
https://github.com/kamailio/kamailio/commit/33228bba33a6ea2e2d9a7acd9a24092…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-05T19:52:11+02:00
db_berkeley: reset lkey to avoid double free
---
Modified: src/modules/db_berkeley/db_berkeley.c
---
Diff:
https://github.com/kamailio/kamailio/commit/33228bba33a6ea2e2d9a7acd9a24092…
Patch:
https://github.com/kamailio/kamailio/commit/33228bba33a6ea2e2d9a7acd9a24092…
---
diff --git a/src/modules/db_berkeley/db_berkeley.c
b/src/modules/db_berkeley/db_berkeley.c
index 80c9aefac0..a8fe812c50 100644
--- a/src/modules/db_berkeley/db_berkeley.c
+++ b/src/modules/db_berkeley/db_berkeley.c
@@ -1055,8 +1055,10 @@ int bdb_update(db1_con_t *_con, db_key_t *_k, db_op_t *_op,
db_val_t *_v,
goto cleanup;
}
- if(lkey)
+ if(lkey) {
pkg_free(lkey);
+ lkey = NULL;
+ }
key.data = kbuf;
key.ulen = MAX_ROW_SIZE;