client-node: don't ref destroyed resource

Ownership of the node_resource is taken by _new() and freed.
Don't try to use it afterwards to send an error when something
goes wrong but use the original resource.
This commit is contained in:
Wim Taymans 2020-05-20 15:18:19 +02:00
parent 963b00b77b
commit 6a689b3c7f

View file

@ -97,11 +97,8 @@ error_resource:
goto error_exit; goto error_exit;
error_node: error_node:
pw_log_error("can't create node: %s", spa_strerror(res)); pw_log_error("can't create node: %s", spa_strerror(res));
pw_resource_errorf(node_resource, res, "can't create node: %s", spa_strerror(res)); pw_resource_errorf_id(resource, new_id, res, "can't create node: %s", spa_strerror(res));
goto error_exit_free; goto error_exit;
error_exit_free:
pw_resource_remove(node_resource);
error_exit: error_exit:
errno = -res; errno = -res;
return NULL; return NULL;