From 16e668c7dd8d721beab89600dea08b9a3157049b Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Thu, 24 Oct 2019 10:15:14 -0400 Subject: [PATCH] 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 --- res/res_calendar_ews.c | 1 + res/res_calendar_exchange.c | 1 + res/res_calendar_icalendar.c | 1 + 3 files changed, 3 insertions(+) diff --git a/res/res_calendar_ews.c b/res/res_calendar_ews.c index c12fb012e0..e4d250ca8e 100644 --- a/res/res_calendar_ews.c +++ b/res/res_calendar_ews.c @@ -118,6 +118,7 @@ static void ewscal_destructor(void *obj) 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 21c1c1a84f..6d624c1331 100644 --- a/res/res_calendar_exchange.c +++ b/res/res_calendar_exchange.c @@ -224,6 +224,7 @@ static void exchangecal_destructor(void *obj) 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 4f78f9a3a7..debb55c82a 100644 --- a/res/res_calendar_icalendar.c +++ b/res/res_calendar_icalendar.c @@ -78,6 +78,7 @@ static void icalendar_destructor(void *obj) 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);