From f007ca475c1f46a1bab05c4da6f8f46214157251 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 26 May 2021 10:18:15 +0200 Subject: [PATCH] pw-cli: handle failure to create context Fixes #1234 --- src/tools/pw-cli.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c index da89f7f4d..215fa5e57 100644 --- a/src/tools/pw-cli.c +++ b/src/tools/pw-cli.c @@ -3027,6 +3027,10 @@ int main(int argc, char *argv[]) PW_KEY_CORE_DAEMON, daemon ? "true" : NULL, NULL), 0); + if (data.context == NULL) { + fprintf(stderr, "Can't create context: %m\n"); + return -1; + } pw_context_load_module(data.context, "libpipewire-module-link-factory", NULL, NULL);