From 9cb4583429fdf695da286f82673c33e038bd7607 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Fri, 7 May 2010 02:10:49 +0200 Subject: [PATCH] Bugfix: mem-problems in ical-code --- src/ical.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ical.cc b/src/ical.cc index c88db80b..68778465 100644 --- a/src/ical.cc +++ b/src/ical.cc @@ -108,6 +108,7 @@ void parse_ical_args(struct text_object *obj, const char* arg, void *free_at_cra curc = icalcomponent_get_first_component(allc, ICAL_VEVENT_COMPONENT); if(!curc) { icalparser_free(parser); + icalcomponent_free(allc); NORM_ERR("No ical events available"); return; } @@ -136,8 +137,10 @@ void parse_ical_args(struct text_object *obj, const char* arg, void *free_at_cra void print_ical(struct text_object *obj, char *p, int p_max_size) { struct obj_ical *ical_obj = (struct obj_ical *) obj->data.opaque; - struct ical_event *ll_current = ical_obj->list; + struct ical_event *ll_current; + if( ! ical_obj) return; + ll_current = ical_obj->list; unsigned int i=1; while(1) { if( ! ll_current) return; @@ -153,6 +156,8 @@ void print_ical(struct text_object *obj, char *p, int p_max_size) { void free_ical(struct text_object *obj) { struct obj_ical *ical_free_me = (struct obj_ical *) obj->data.opaque; + + if( ! ical_free_me) return; icalcomponent_free(ical_free_me->comps); icalparser_free(ical_free_me->parser); while(ical_free_me->list) {