-rw-r--r-- | libkcal/icalformatimpl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp index fe7413f..2405682 100644 --- a/libkcal/icalformatimpl.cpp +++ b/libkcal/icalformatimpl.cpp @@ -694,14 +694,16 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) icalcomponent_add_property(a,icalproperty_new_attach(attach)); if (!alarm->programArguments().isEmpty()) { icalcomponent_add_property(a,icalproperty_new_description(alarm->programArguments().utf8())); } + icalattach_unref( attach ); break; case Alarm::Audio: action = ICAL_ACTION_AUDIO; if (!alarm->audioFile().isEmpty()) { attach = icalattach_new_from_url(QFile::encodeName( alarm->audioFile() ).data()); - icalcomponent_add_property(a,icalproperty_new_attach(attach)); + icalcomponent_add_property(a,icalproperty_new_attach(attach)); + icalattach_unref( attach ); } break; case Alarm::Email: { action = ICAL_ACTION_EMAIL; @@ -718,9 +720,10 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) QStringList attachments = alarm->mailAttachments(); if (attachments.count() > 0) { for (QStringList::Iterator at = attachments.begin(); at != attachments.end(); ++at) { attach = icalattach_new_from_url(QFile::encodeName( *at ).data()); - icalcomponent_add_property(a,icalproperty_new_attach(attach)); + icalcomponent_add_property(a,icalproperty_new_attach(attach)); + icalattach_unref( attach ); } } break; } |