summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2012-04-06 22:00:58 +0000
committerMatthew Jordan <mjordan@digium.com>2012-04-06 22:00:58 +0000
commit90226b6fd7e21eb149c8def79596247ed2366b6e (patch)
tree053b24230b4581a76e693127c8ce01c3591ea686
parentaa21d4fc6b1cef694d29939d97967183f849d245 (diff)
Fix memory leak in res_calendar_ews when event email address node is empty
If the XML calendar data returned by a Microsoft Exchange Web Service specifies an XML Event E-Mail Address ("EmailAddress"), and no e-mail address is provided, a condition existed where an ast_calendar_attendee struct would be allocated but not appended to the list of attendees. Because of that, the memory associated with the attendee would never be freed. This patch frees the memory if no e-mail address is provided. ........ Merged revisions 361606 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 361607 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361608 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--res/res_calendar_ews.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_calendar_ews.c b/res/res_calendar_ews.c
index 51761127e..d33f4be4f 100644
--- a/res/res_calendar_ews.c
+++ b/res/res_calendar_ews.c
@@ -424,6 +424,8 @@ static int endelm(void *userdata, int state, const char *nspace, const char *nam
if (ast_str_strlen(ctx->cdata)) {
attendee->data = ast_strdup(ast_str_buffer(ctx->cdata));
AST_LIST_INSERT_TAIL(&ctx->event->attendees, attendee, next);
+ } else {
+ ast_free(attendee);
}
ast_debug(3, "EWS: XML: attendee address '%s'\n", ast_str_buffer(ctx->cdata));
ast_str_reset(ctx->cdata);