char const *ct_s = NULL;
if (ev == NULL) {
- char *o_type = su_strdup(home, event->o_type);
- char *o_subtype = o_type ? strchr(o_type, '.') : NULL;
+ char *o_type, *o_subtype;
+ char *temp = NULL;
+ o_type = su_strdup(home, event->o_type);
+ if (o_type == NULL)
+ return NULL;
+ o_subtype = strchr(o_type, '.');
if (o_subtype)
*o_subtype++ = '\0';
* types
*/
if (accept_s == NULL && accept)
- accept_s = sip_header_as_string(home, (sip_header_t *)accept);
+ accept_s = temp = sip_header_as_string(home, (sip_header_t *)accept);
if (accept_s == NULL && ct)
accept_s = ct->c_type;
if (accept_s == NULL && ct_s)
o_type, o_subtype,
ct ? ct->c_type : ct_s,
accept_s);
+
+ su_free(home, temp);
+ su_free(home, o_type);
}
return ev;