[svn-commits] mjordan: trunk r361608 - in /trunk: ./ res/res_calendar_ews.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Apr 6 17:01:02 CDT 2012


Author: mjordan
Date: Fri Apr  6 17:00:58 2012
New Revision: 361608

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=361608
Log:
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

Modified:
    trunk/   (props changed)
    trunk/res/res_calendar_ews.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/res/res_calendar_ews.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_calendar_ews.c?view=diff&rev=361608&r1=361607&r2=361608
==============================================================================
--- trunk/res/res_calendar_ews.c (original)
+++ trunk/res/res_calendar_ews.c Fri Apr  6 17:00:58 2012
@@ -424,6 +424,8 @@
 		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);




More information about the svn-commits mailing list