From 30cef0e29c39402b91cd6d4b4d323cf3bf9fd033 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Sat, 5 Oct 2019 20:41:50 +0200 Subject: [PATCH] presence: free allocated memory in case of error (cherry picked from commit 4e6c8fe6073d7d52bab66faa68abad2f685d2090) --- src/modules/presence/notify.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/presence/notify.c b/src/modules/presence/notify.c index f9ce4c403f6..245c2b95c0b 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));