From 18d8a713fda0a8a8bdb8cb2a6dbb1b1136d6b3ef Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 3 Oct 2008 17:04:44 +0000 Subject: [PATCH] Changed all instances of x = strdup(icalcomponent_as_ical_string(y)) to x = icalcomponent_as_ical_string_r(y) to eliminate the second buffer and move to the new API. --- citadel/modules/calendar/serv_calendar.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/citadel/modules/calendar/serv_calendar.c b/citadel/modules/calendar/serv_calendar.c index b1cc6e496..34985c4af 100644 --- a/citadel/modules/calendar/serv_calendar.c +++ b/citadel/modules/calendar/serv_calendar.c @@ -124,7 +124,7 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) { return; } - ser = icalcomponent_as_ical_string(cal); + ser = icalcomponent_as_ical_string_r(cal); if (ser == NULL) return; /* If the caller supplied a user, write to that user's default calendar room */ @@ -162,7 +162,7 @@ void ical_write_to_cal(struct ctdluser *u, icalcomponent *cal) { } /* In either case, now we can free the serialized calendar object */ -// free(ser); + free(ser); } @@ -315,7 +315,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) { } /* Now generate the reply message and send it out. */ - serialized_reply = strdup(icalcomponent_as_ical_string(the_reply)); + serialized_reply = icalcomponent_as_ical_string_r(the_reply); icalcomponent_free(the_reply); /* don't need this anymore */ if (serialized_reply == NULL) return; @@ -688,7 +688,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) { ical_merge_attendee_reply(original_event, cal); /* Serialize it */ - serialized_event = strdup(icalcomponent_as_ical_string(original_event)); + serialized_event = icalcomponent_as_ical_string_r(original_event); icalcomponent_free(original_event); /* Don't need this anymore. */ if (serialized_event == NULL) return(2); @@ -1469,7 +1469,7 @@ void ical_freebusy(char *who) { /* Serialize it */ CtdlLogPrintf(CTDL_DEBUG, "Serializing\n"); - serialized_request = strdup(icalcomponent_as_ical_string(encaps)); + serialized_request = icalcomponent_as_ical_string_r(encaps); icalcomponent_free(encaps); /* Don't need this anymore. */ cprintf("%d Here is the free/busy data:\n", LISTING_FOLLOWS); @@ -1585,7 +1585,7 @@ void ical_getics(void) (void *) encaps ); - ser = strdup(icalcomponent_as_ical_string(encaps)); + ser = icalcomponent_as_ical_string_r(encaps); client_write(ser, strlen(ser)); free(ser); cprintf("\n000\n"); @@ -1904,7 +1904,7 @@ void ical_send_out_invitations(icalcomponent *cal) { icalcomponent_add_component(encaps, the_request); /* Serialize it */ - serialized_request = strdup(icalcomponent_as_ical_string(encaps)); + serialized_request = icalcomponent_as_ical_string_r(encaps); icalcomponent_free(encaps); /* Don't need this anymore. */ if (serialized_request == NULL) return; -- 2.30.2