Module: kamailio
Branch: master
Commit: d7770cae2ee68be7184298b2bb41cb0ba3ebb47d
URL:
https://github.com/kamailio/kamailio/commit/d7770cae2ee68be7184298b2bb41cb0…
Author: Pantelis Kolatsis <pk(a)gilawa.com>
Committer: Henning Westerholt <hw(a)gilawa.com>
Date: 2023-03-22T11:20:08Z
benchmark: properly free previous allocated memory in case of error
---
Modified: src/modules/benchmark/benchmark.c
---
Diff:
https://github.com/kamailio/kamailio/commit/d7770cae2ee68be7184298b2bb41cb0…
Patch:
https://github.com/kamailio/kamailio/commit/d7770cae2ee68be7184298b2bb41cb0…
---
diff --git a/src/modules/benchmark/benchmark.c b/src/modules/benchmark/benchmark.c
index cb1e288be16..09af04abf88 100644
--- a/src/modules/benchmark/benchmark.c
+++ b/src/modules/benchmark/benchmark.c
@@ -443,6 +443,8 @@ int _bm_register_timer(char *tname, int mode, unsigned int *id)
if(bm_mycfg->tindex==0)
{
SHM_MEM_ERROR;
+ shm_free(bmt);
+ pkg_free(bmt->start);
if(tidx!=0)
shm_free(tidx);
return -1;