[sr-dev] git:master:4e6c8fe6: presence: free allocated memory in case of error

Daniel-Constantin Mierla miconda at gmail.com
Sat Oct 5 20:45:10 CEST 2019


Module: kamailio
Branch: master
Commit: 4e6c8fe6073d7d52bab66faa68abad2f685d2090
URL: https://github.com/kamailio/kamailio/commit/4e6c8fe6073d7d52bab66faa68abad2f685d2090

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-10-05T20:41:50+02:00

presence: free allocated memory in case of error

---

Modified: src/modules/presence/notify.c

---

Diff:  https://github.com/kamailio/kamailio/commit/4e6c8fe6073d7d52bab66faa68abad2f685d2090.diff
Patch: https://github.com/kamailio/kamailio/commit/4e6c8fe6073d7d52bab66faa68abad2f685d2090.patch

---

diff --git a/src/modules/presence/notify.c b/src/modules/presence/notify.c
index f9ce4c403f..245c2b95c0 100644
--- a/src/modules/presence/notify.c
+++ b/src/modules/presence/notify.c
@@ -2018,6 +2018,7 @@ int add_waiting_watchers(watcher_t *watchers, str pres_uri, str event)
 
 		w = (watcher_t *)pkg_malloc(sizeof(watcher_t));
 		if(w == NULL) {
+			pkg_free(wuri.s);
 			ERR_MEM(PKG_MEM_STR);
 		}
 		memset(w, 0, sizeof(watcher_t));




More information about the sr-dev mailing list