port: copy error string in update_state

update_state will free the error string later so we need to make
a copy of static strings.
This commit is contained in:
Wim Taymans 2020-02-27 13:28:06 +01:00
parent b7dbf4bbc1
commit d39dbceb2a

View file

@ -1267,7 +1267,7 @@ int pw_impl_port_use_buffers(struct pw_impl_port *port, struct pw_impl_port_mix
pw_log_error(NAME" %p: negotiate buffers on node: %d (%s)", pw_log_error(NAME" %p: negotiate buffers on node: %d (%s)",
port, res, spa_strerror(res)); port, res, spa_strerror(res));
pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_ERROR, pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_ERROR,
"can't negotiate buffers on port"); strdup("can't negotiate buffers on port"));
} else if (n_buffers > 0 && !SPA_RESULT_IS_ASYNC(res)) { } else if (n_buffers > 0 && !SPA_RESULT_IS_ASYNC(res)) {
pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_PAUSED, NULL); pw_impl_port_update_state(port, PW_IMPL_PORT_STATE_PAUSED, NULL);
} }