]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_calendar: Resolve memory leak on calendar destruction
authorSean Bright <sean.bright@gmail.com>
Thu, 24 Oct 2019 14:15:14 +0000 (10:15 -0400)
committerSean Bright <sean.bright@gmail.com>
Thu, 24 Oct 2019 14:15:14 +0000 (10:15 -0400)
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
res/res_calendar_exchange.c
res/res_calendar_icalendar.c

index 76e07e9b3f0679ecb680c324bdbafed26d056540..fe0299b325b915595cf6482ee1582c7546bfd6ad 100644 (file)
@@ -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);
index d2edd017ddba98a9bd2702b4748d27eb72b1be7e..2cfa37b114a02a6a1dd85e77c52fbd1d3cb0267b 100644 (file)
@@ -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);
index ff212a0f1c8ab0aa1a5c179b49301b8b73ea0f29..cde3a84209022fb9446f4e7e817c3135ea191ed7 100644 (file)
@@ -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);