Module: kamailio
Branch: master
Commit: 28dc74fa8a30b17abd7f7b173b66b8538c5a4bb5
URL:
https://github.com/kamailio/kamailio/commit/28dc74fa8a30b17abd7f7b173b66b85…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-09-16T09:45:33+02:00
presence: reset freed list to avoid double free in case of error
---
Modified: src/modules/presence/event_list.c
---
Diff:
https://github.com/kamailio/kamailio/commit/28dc74fa8a30b17abd7f7b173b66b85…
Patch:
https://github.com/kamailio/kamailio/commit/28dc74fa8a30b17abd7f7b173b66b85…
---
diff --git a/src/modules/presence/event_list.c b/src/modules/presence/event_list.c
index 0865412ec2..6f062614e1 100644
--- a/src/modules/presence/event_list.c
+++ b/src/modules/presence/event_list.c
@@ -142,6 +142,7 @@ int add_event(pres_ev_t *event)
ev = (pres_ev_t *)shm_malloc(sizeof(pres_ev_t));
if(ev == NULL) {
free_event_params(parsed_event.params.list, PKG_MEM_TYPE);
+ parsed_event.params.list = NULL;
ERR_MEM(SHARE_MEM);
}
memset(ev, 0, sizeof(pres_ev_t));