[Asterisk-code-review] res_calendar: Resolve memory leak on calendar destruction (...asterisk[13])

Sean Bright asteriskteam at digium.com
Thu Oct 24 09:17:38 CDT 2019


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13107


Change subject: res_calendar: Resolve memory leak on calendar destruction
......................................................................

res_calendar: Resolve memory leak on calendar destruction

Calling ne_uri_parse allocates memory that needs to be freed with a
corresponding call to ne_uri_free.

ASTERISK-28572 #close

Change-Id: I8a6834da27000a6807d89cb7a157b2a88fcb5e61
---
M res/res_calendar_ews.c
M res/res_calendar_exchange.c
M res/res_calendar_icalendar.c
3 files changed, 3 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/13107/1

diff --git a/res/res_calendar_ews.c b/res/res_calendar_ews.c
index 76e07e9..fe0299b 100644
--- a/res/res_calendar_ews.c
+++ b/res/res_calendar_ews.c
@@ -120,6 +120,7 @@
 	if (pvt->session) {
 		ne_session_destroy(pvt->session);
 	}
+	ne_uri_free(&pvt->uri);
 	ast_string_field_free_memory(pvt);
 
 	ao2_callback(pvt->events, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
diff --git a/res/res_calendar_exchange.c b/res/res_calendar_exchange.c
index d2edd01..2cfa37b 100644
--- a/res/res_calendar_exchange.c
+++ b/res/res_calendar_exchange.c
@@ -226,6 +226,7 @@
 	if (pvt->session) {
 		ne_session_destroy(pvt->session);
 	}
+	ne_uri_free(&pvt->uri);
 	ast_string_field_free_memory(pvt);
 
 	ao2_callback(pvt->events, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);
diff --git a/res/res_calendar_icalendar.c b/res/res_calendar_icalendar.c
index ff212a0..cde3a84 100644
--- a/res/res_calendar_icalendar.c
+++ b/res/res_calendar_icalendar.c
@@ -80,6 +80,7 @@
 	if (pvt->data) {
 		icalcomponent_free(pvt->data);
 	}
+	ne_uri_free(&pvt->uri);
 	ast_string_field_free_memory(pvt);
 
 	ao2_callback(pvt->events, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13107
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I8a6834da27000a6807d89cb7a157b2a88fcb5e61
Gerrit-Change-Number: 13107
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20191024/3288a719/attachment.html>


More information about the asterisk-code-review mailing list