From: Sean Bright Date: Thu, 24 Oct 2019 14:15:14 +0000 (-0400) Subject: res_calendar: Resolve memory leak on calendar destruction X-Git-Tag: 13.30.0-rc1~34^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27fc662cf27575e174fbe01da84bfbe7d7575447;p=thirdparty%2Fasterisk.git 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 --- diff --git a/res/res_calendar_ews.c b/res/res_calendar_ews.c index 76e07e9b3f..fe0299b325 100644 --- a/res/res_calendar_ews.c +++ b/res/res_calendar_ews.c @@ -120,6 +120,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 d2edd017dd..2cfa37b114 100644 --- a/res/res_calendar_exchange.c +++ b/res/res_calendar_exchange.c @@ -226,6 +226,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 ff212a0f1c..cde3a84209 100644 --- a/res/res_calendar_icalendar.c +++ b/res/res_calendar_icalendar.c @@ -80,6 +80,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);