aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libical/ChangeLog5
-rw-r--r--libical/src/libical/icalperiod.c6
-rw-r--r--libical/src/libical/icalvalue.c9
3 files changed, 16 insertions, 4 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index 4a3ae383d6..bb1cb362f0 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,8 @@
+2001-09-19 Larry Ewing <lewing@ximian.com>
+
+ * src/libical/icalperiod.c (icalperiodtype_from_string): free the
+ temp dup'd string.
+
2001-09-11 Federico Mena Quintero <federico@ximian.com>
* src/libical/icalvalue.c (icalvalue_new_from_string_with_error):
diff --git a/libical/src/libical/icalperiod.c b/libical/src/libical/icalperiod.c
index c74c157eff..6117df526f 100644
--- a/libical/src/libical/icalperiod.c
+++ b/libical/src/libical/icalperiod.c
@@ -96,11 +96,15 @@ struct icalperiodtype icalperiodtype_from_string (const char* str)
}
icalerrno = e;
-
+
+ icalmemory_free_buffer (s);
return p;
error:
icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);
+
+ if (s)
+ icalmemory_free_buffer (s);
return null_p;
}
diff --git a/libical/src/libical/icalvalue.c b/libical/src/libical/icalvalue.c
index adcf6abbe5..7414c7c173 100644
--- a/libical/src/libical/icalvalue.c
+++ b/libical/src/libical/icalvalue.c
@@ -419,11 +419,14 @@ icalvalue_new_from_string_with_error(icalvalue_kind kind,const char* str,icalpro
struct icaltimetype tt;
struct icalperiodtype p;
tt = icaltime_from_string(str);
- p = icalperiodtype_from_string(str);
if(!icaltime_is_null_time(tt)){
- value = icalvalue_new_datetime(tt);
- } else if (!icalperiodtype_is_null_period(p)){
+ value = icalvalue_new_datetime(tt);
+ break;
+ }
+
+ p = icalperiodtype_from_string(str);
+ if (!icalperiodtype_is_null_period(p)){
value = icalvalue_new_period(p);
}