mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-21 21:37:39 -04:00
modules: free the stream and impl on errors
This commit is contained in:
parent
aa36fd5a17
commit
e9aff3040a
2 changed files with 12 additions and 5 deletions
|
|
@ -926,8 +926,7 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
|||
spa_dll_set_bw(&impl->dll, SPA_DLL_BW_MIN, 128, impl->rate);
|
||||
impl->corr = 1.0;
|
||||
|
||||
impl->stream = pw_stream_new(core, "rtp-session", props);
|
||||
props = NULL;
|
||||
impl->stream = pw_stream_new(core, "rtp-session", spa_steal_ptr(props));
|
||||
if (impl->stream == NULL) {
|
||||
res = -errno;
|
||||
pw_log_error("can't create stream: %m");
|
||||
|
|
@ -1014,6 +1013,11 @@ struct rtp_stream *rtp_stream_new(struct pw_core *core,
|
|||
return (struct rtp_stream*)impl;
|
||||
out:
|
||||
pw_properties_free(props);
|
||||
if (impl) {
|
||||
if (impl->stream)
|
||||
pw_stream_destroy(impl->stream);
|
||||
free(impl);
|
||||
}
|
||||
errno = -res;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue