mirror of
https://gitlab.freedesktop.org/pipewire/pipewire
synced 2024-09-06 16:56:00 +00:00
alsa: don't leak properties on error
This commit is contained in:
parent
ac54b7ace1
commit
e11d35107f
|
@ -890,7 +890,7 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, const char *name,
|
||||||
snd_pcm_pipewire_t *pw;
|
snd_pcm_pipewire_t *pw;
|
||||||
int err;
|
int err;
|
||||||
const char *str;
|
const char *str;
|
||||||
struct pw_properties *props;
|
struct pw_properties *props = NULL;
|
||||||
struct pw_loop *loop;
|
struct pw_loop *loop;
|
||||||
|
|
||||||
assert(pcmp);
|
assert(pcmp);
|
||||||
|
@ -947,6 +947,7 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, const char *name,
|
||||||
|
|
||||||
pw_thread_loop_lock(pw->main_loop);
|
pw_thread_loop_lock(pw->main_loop);
|
||||||
pw->core = pw_context_connect(pw->context, props, 0);
|
pw->core = pw_context_connect(pw->context, props, 0);
|
||||||
|
props = NULL;
|
||||||
if (pw->core == NULL) {
|
if (pw->core == NULL) {
|
||||||
err = -errno;
|
err = -errno;
|
||||||
pw_thread_loop_unlock(pw->main_loop);
|
pw_thread_loop_unlock(pw->main_loop);
|
||||||
|
@ -983,7 +984,9 @@ static int snd_pcm_pipewire_open(snd_pcm_t **pcmp, const char *name,
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
if (props)
|
||||||
|
pw_properties_free(props);
|
||||||
snd_pcm_pipewire_free(pw);
|
snd_pcm_pipewire_free(pw);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue