media-session: don't use-after-free if linking node removed

Should fix an ASAN crash.
This commit is contained in:
Pauli Virtanen 2021-09-16 19:18:52 +03:00
parent 4997d47f63
commit 39c8ed4f62

View file

@ -869,6 +869,7 @@ static int link_nodes(struct node *node, struct node *peer)
struct pw_properties *props;
struct node *output, *input;
int res;
uint32_t node_id = node->id;
pw_log_debug(NAME " %p: link nodes %d %d remix:%d", impl,
node->id, peer->id, !node->dont_remix);
@ -902,7 +903,7 @@ static int link_nodes(struct node *node, struct node *peer)
if (impl->linking_node_removed) {
impl->linking_node_removed = false;
pw_log_info("linking node %d was removed", node->id);
pw_log_info("linking node %d was removed", node_id);
return -ENOENT;
}
node->linking = false;