[sr-dev] git:5.3:30cef0e2: presence: free allocated memory in case of error

Daniel-Constantin Mierla miconda at gmail.com
Mon Oct 7 11:02:09 CEST 2019


Module: kamailio
Branch: 5.3
Commit: 30cef0e29c39402b91cd6d4b4d323cf3bf9fd033
URL: https://github.com/kamailio/kamailio/commit/30cef0e29c39402b91cd6d4b4d323cf3bf9fd033

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-10-07T10:52:54+02:00

presence: free allocated memory in case of error

(cherry picked from commit 4e6c8fe6073d7d52bab66faa68abad2f685d2090)

---

Modified: src/modules/presence/notify.c

---

Diff:  https://github.com/kamailio/kamailio/commit/30cef0e29c39402b91cd6d4b4d323cf3bf9fd033.diff
Patch: https://github.com/kamailio/kamailio/commit/30cef0e29c39402b91cd6d4b4d323cf3bf9fd033.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