From 9903d73f36809c20795d5a918f2898fa6b8b88f8 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Thu, 7 Apr 2022 00:26:56 +0000 Subject: [PATCH] linux-capture: Don't initialize format info if init_obs_pipewire fails The pointer has been freed by this point so it just segfaults. Signed-off-by: Joshua Ashton --- plugins/linux-pipewire/pipewire.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/linux-pipewire/pipewire.c b/plugins/linux-pipewire/pipewire.c index 07b94d439..f365d0723 100644 --- a/plugins/linux-pipewire/pipewire.c +++ b/plugins/linux-pipewire/pipewire.c @@ -1434,8 +1434,10 @@ void *obs_pipewire_create(enum obs_pw_capture_type capture_type, obs_pw->restore_token = bstrdup(obs_data_get_string(settings, "RestoreToken")); - if (!init_obs_pipewire(obs_pw)) + if (!init_obs_pipewire(obs_pw)) { g_clear_pointer(&obs_pw, bfree); + return NULL; + } init_format_info(obs_pw);