From 8e24e57db008040f9d8ecd466a813ccb55e51097 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 26 Nov 2019 17:52:27 +0100 Subject: [PATCH] endpoint: handle NULL name and media_class --- src/modules/module-session-manager/endpoint.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/module-session-manager/endpoint.c b/src/modules/module-session-manager/endpoint.c index ac0c0dc11..1b98ea095 100644 --- a/src/modules/module-session-manager/endpoint.c +++ b/src/modules/module-session-manager/endpoint.c @@ -68,6 +68,8 @@ static int endpoint_enum_params (void *object, int seq, uint32_t next = start; uint32_t count = 0; + pw_log_debug(NAME" %p: param %u %d/%d", this, id, start, num); + while (true) { index = next++; if (index >= this->n_params) @@ -224,8 +226,8 @@ int endpoint_update(struct endpoint *this, } if (!this->info.name) { - this->info.name = strdup(info->name); - this->info.media_class = strdup(info->media_class); + this->info.name = info->name ? strdup(info->name) : NULL; + this->info.media_class = info->media_class ? strdup(info->media_class) : NULL; this->info.direction = info->direction; this->info.flags = info->flags; }