rem: char *s = strdup(str);
add: char *s = icalmemory_strdup(str);
context: struct icalperiodtype icalperiodtype_from_string (const char* str){        struct icalperiodtype p, null_p;    char *s = strdup(str);    char *start, *end = s;    icalerrorstate es;    /* Errors are normally generated in the following code, so save       the error state for resoration later */    icalerrorenum e = icalerrno;    p.start = p.end = icaltime_null_time();    p.duration = icaldurationtype_from_int(0);    null_p = p;    if(s == 0) goto error;    start = s;    end = strchr(s, '/');    if(end == 0) goto error;    *end = 0;    end++;    p.start = icaltime_from_string(start);    if (icaltime_is_null_time(p.start)) goto error;    es = icalerror_get_error_state(ICAL_MALFORMEDDATA_ERROR);    icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,ICAL_ERROR_NONFATAL);    p.end = icaltime_from_string(end);    icalerror_set_error_state(ICAL_MALFORMEDDATA_ERROR,es);        if (icaltime_is_null_time(p.end)){	p.duration = icaldurationtype_from_string(end);	if(icaldurationtype_as_int(p.duration) == 0) goto error;    }     icalerrno = e;    return p; error:    icalerror_set_errno(ICAL_MALFORMEDDATA_ERROR);    return null_p;}