aboutsummaryrefslogtreecommitdiffstats
path: root/libical/scripts
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-03-18 09:48:41 +0800
committerHans Petter <hansp@src.gnome.org>2003-03-18 09:48:41 +0800
commit93e6b5f8f49e61cd1153626afd3026efba19e1f1 (patch)
tree22dab7c3741e4521b46f47b827fd97a73ded47e2 /libical/scripts
parent76d5d480974306cceaa4770620936d19a9b6170d (diff)
downloadgsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.tar
gsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.tar.gz
gsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.tar.bz2
gsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.tar.lz
gsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.tar.xz
gsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.tar.zst
gsoc2013-evolution-93e6b5f8f49e61cd1153626afd3026efba19e1f1.zip
Part of fix for #34095
2003-03-17 Hans Petter Jansson <hpj@ximian.com> Part of fix for #34095 * scripts/mkderivedparameters.pl: Generate code to free old string value when a new one is set. * src/libical/icalperiod.c (icalperiodtype_as_ical_string): Callers expect a temporary string, and thus won't free it, so allocate returned memory from the temporary ring. svn path=/trunk/; revision=20330
Diffstat (limited to 'libical/scripts')
-rwxr-xr-xlibical/scripts/mkderivedparameters.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/libical/scripts/mkderivedparameters.pl b/libical/scripts/mkderivedparameters.pl
index 5772065ec4..89f25306a5 100755
--- a/libical/scripts/mkderivedparameters.pl
+++ b/libical/scripts/mkderivedparameters.pl
@@ -188,7 +188,9 @@ foreach $param (keys %params){
$charorenum = " icalerror_check_arg_rz( (param!=0), \"param\");\n return ($type)((struct icalparameter_impl*)param)->string;";
- $set_code = "((struct icalparameter_impl*)param)->string = icalmemory_strdup(v);";
+ $set_code = "if (((struct icalparameter_impl*)param)->string != 0)\n" .
+ " free((void *) ((struct icalparameter_impl*)param)->string);\n" .
+ " ((struct icalparameter_impl*)param)->string = icalmemory_strdup(v);";
$pointer_check = "icalerror_check_arg_rz( (v!=0),\"v\");";
$pointer_check_v = "icalerror_check_arg_rv( (v!=0),\"v\");";