aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-09-20 03:34:19 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-09-20 03:34:19 +0800
commit00dcd396edfc585316b8778e4b1121c6edf8390e (patch)
tree6130f9e7362820ccc0e5ca882081961a3abe27ec
parente5c7ee01fd8892709c7c6d7e925fdbaa37ff406e (diff)
downloadgsoc2013-evolution-00dcd396edfc585316b8778e4b1121c6edf8390e.tar.gz
gsoc2013-evolution-00dcd396edfc585316b8778e4b1121c6edf8390e.tar.zst
gsoc2013-evolution-00dcd396edfc585316b8778e4b1121c6edf8390e.zip
free the temp dup'd string.
2001-09-19 Larry Ewing <lewing@ximian.com> * src/libical/icalperiod.c (icalperiodtype_from_string): free the temp dup'd string. svn path=/trunk/; revision=12984
-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);
}