summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-10-06 09:43:51 -0400
committerAllen Winter <allen.winter@kdab.com>2022-10-06 09:43:51 -0400
commite8120c0665e9a231d97d8aacd6a897b979c45728 (patch)
treefef27e2723c564050ecaca67cee8c2e3a99b77a9 /examples
parente75ab3b4e8caef6470903cbdc1e8048c47be4c36 (diff)
downloadlibical-git-e8120c0665e9a231d97d8aacd6a897b979c45728.tar.gz
fix a few resource leaks in the tests and examples
as found by Coverity.
Diffstat (limited to 'examples')
-rw-r--r--examples/errors.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/errors.c b/examples/errors.c
index f50c4c9d..25bccfdd 100644
--- a/examples/errors.c
+++ b/examples/errors.c
@@ -9,15 +9,13 @@ void program_errors()
icalerror_clear_errno();
- (void)icalcomponent_new(ICAL_VEVENT_COMPONENT);
+ icalcomponent *comp = icalcomponent_new(ICAL_VEVENT_COMPONENT);
if (icalerrno != ICAL_NO_ERROR){
-
fprintf(stderr,"Horrible libical error: %s\n",
icalerror_strerror(icalerrno));
-
}
-
+ icalcomponent_free(comp);
}
void component_errors(icalcomponent *comp)