evolution-mapi r16 - trunk/src/libexchangemapi



Author: msuman
Date: Fri Nov 28 04:04:53 2008
New Revision: 16
URL: http://svn.gnome.org/viewvc/evolution-mapi?rev=16&view=rev

Log:
Fix for bug #562202 - Allocate memory, if not done already, before attempting to increase the size of the SRowSet.

Modified:
   trunk/src/libexchangemapi/ChangeLog
   trunk/src/libexchangemapi/exchange-mapi-connection.c

Modified: trunk/src/libexchangemapi/exchange-mapi-connection.c
==============================================================================
--- trunk/src/libexchangemapi/exchange-mapi-connection.c	(original)
+++ trunk/src/libexchangemapi/exchange-mapi-connection.c	Fri Nov 28 04:04:53 2008
@@ -812,7 +812,6 @@
 					  PR_GIVEN_NAME);
 
 
-	SRowSet = talloc_zero(mem_ctx, struct SRowSet);
 	count = g_slist_length (recipients);
 	users = g_new0 (const char *, count + 1);
 
@@ -840,7 +839,12 @@
 			g_warning ("\n%s:%d %s() - '%s' is ambiguous ", __FILE__, __LINE__, __PRETTY_FUNCTION__, recipient->email_id);
 		} else if (FlagList->aulPropTag[i] == MAPI_UNRESOLVED) {
 			/* If the recipient is unresolved, consider it is a SMTP one */
-			SRowSet->aRow = talloc_realloc(mem_ctx, SRowSet->aRow, struct SRow, SRowSet->cRows + 1);
+			if (SRowSet) {
+				SRowSet->aRow = talloc_realloc(mem_ctx, SRowSet->aRow, struct SRow, SRowSet->cRows + 1);
+			} else {
+				SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+				SRowSet->aRow = talloc_zero(mem_ctx, struct SRow);
+			}
 			last = SRowSet->cRows;
 			SRowSet->aRow[last].cValues = 0;
 			SRowSet->aRow[last].lpProps = talloc_zero(mem_ctx, struct SPropValue);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]