-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 @@ -696,4 +696,5 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) icalcomponent_add_property(a,icalproperty_new_description(alarm->programArguments().utf8())); } + icalattach_unref( attach ); break; case Alarm::Audio: @@ -701,5 +702,6 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) 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; @@ -720,5 +722,6 @@ icalcomponent *ICalFormatImpl::writeAlarm(Alarm *alarm) 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 ); } } |