modules: handle allocation errors gracefully

This commit is contained in:
Wim Taymans 2026-05-05 13:10:21 +02:00
parent 24f9b9a335
commit dd695ee5a7
6 changed files with 35 additions and 4 deletions

View file

@ -622,6 +622,12 @@ static struct session *make_session(struct impl *impl, struct service_info *info
str = pw_properties_get(props, "sess.name");
sess->name = str ? strdup(str) : strdup("RTP Session");
if (sess->info.name == NULL || sess->info.type == NULL ||
sess->info.domain == NULL || sess->name == NULL) {
free_session(sess);
goto error;
}
if (impl->ts_refclk != NULL)
pw_properties_setf(props, "rtp.sender-ts-offset", "%u", impl->ts_offset);
pw_properties_setf(props, "rtp.sender-ssrc", "%u", sess->ssrc);