mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
alsa: don't leak properties on error
This commit is contained in:
parent
ac54b7ace1
commit
e11d35107f
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
@ -984,6 +985,8 @@ 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…
Add table
Add a link
Reference in a new issue