module-rtp: release data_loop on rtp_stream_new error path

rtp_stream_new() acquires a data loop with pw_context_acquire_loop() but
the out: error path never calls pw_context_release_loop(), leaking the loop
reference on every failure after acquisition.

Mirror rtp_stream_destroy() and other modules that pair acquire with release.
This commit is contained in:
zuozhiwei 2026-06-22 09:43:45 +08:00 committed by Wim Taymans
parent bff0a410dd
commit 8c1123358c

View file

@ -1014,6 +1014,13 @@ 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);
if (impl->data_loop)
pw_context_release_loop(impl->context, impl->data_loop);
free(impl);
}
errno = -res;
return NULL;
}