Index: src/test/regression.c =================================================================== --- src/test/regression.c (revision 1031) +++ src/test/regression.c (working copy) @@ -1345,11 +1345,9 @@ p = icalproperty_new_from_string("REQUEST-STATUS:2.1;Success but fallback taken on one or more property values.;booga"); -#if ADD_TESTS_REQUIRING_INVESTIGATION is("icalproperty_new_from_string()", icalproperty_as_ical_string(p), - "REQUEST-STATUS:2.1;Success but fallback taken on one or more property \n values.;booga\n"); -#endif + "REQUEST-STATUS:2.1;Success but fallback taken on one or more property \r\n values.;booga\r\n"); icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL); st2 = icalreqstattype_from_string("16.4"); Index: src/libical/icalvalue.c =================================================================== --- src/libical/icalvalue.c (revision 1027) +++ src/libical/icalvalue.c (working copy) @@ -726,6 +726,14 @@ } break; } + case ICAL_REQUESTSTATUS_VALUE: + { + if (v->data.v_requeststatus.debug != 0) { + free((void*)v->data.v_requeststatus.debug); + v->data.v_requeststatus.debug = 0; + } + break; + } default: { Index: src/libical/icaltypes.c =================================================================== --- src/libical/icaltypes.c (revision 1027) +++ src/libical/icaltypes.c (working copy) @@ -131,7 +131,7 @@ stat.code = ICAL_UNKNOWN_STATUS; stat.debug = 0; - stat.desc = 0; + stat.desc = 0; /* Get the status numbers */ @@ -148,7 +148,6 @@ icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR); return stat; } - p1 = strchr(str,';'); @@ -160,11 +159,9 @@ /* Just ignore the second clause; it will be taken from inside the library */ - - p2 = strchr(p1+1,';'); if (p2 != 0 && *p2 != 0){ - stat.debug = p2+1; + stat.debug = icalmemory_strdup(p2+1); } return stat; Index: src/libical/icaltypes.h =================================================================== --- src/libical/icaltypes.h (revision 1027) +++ src/libical/icaltypes.h (working copy) @@ -58,19 +58,18 @@ int icaltriggertype_is_null_trigger(struct icaltriggertype tr); int icaltriggertype_is_bad_trigger(struct icaltriggertype tr); -/* struct icalreqstattype. This struct contains two string pointers, -but don't try to free either of them. The "desc" string is a pointer -to a static table inside the library. Don't try to free it. The -"debug" string is a pointer into the string that the called passed -into to icalreqstattype_from_string. Don't try to free it either, and -don't use it after the original string has been freed. +/* +struct icalreqstattype. This struct contains two string pointers. +The "desc" string is a pointer to a static table inside the library. +Don't try to free it. The "debug" string is a pointer to an icalmemory +string, which the user must deallocate using icalmemory_free_buffer, if +its not a NULL pointer. BTW, you would get that original string from *icalproperty_get_requeststatus() or icalvalue_get_text(), when operating on a the value of a request_status property. */ struct icalreqstattype { - icalrequeststatus code; const char* desc; const char* debug;