diff options
author | Timo Wischer <twischer@de.adit-jv.com> | 2018-07-30 16:04:59 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-08-01 19:10:05 +0200 |
commit | fde74494c925cc5323d201972722aed6f4849506 (patch) | |
tree | fdc61080fa210d07a237000e9b8504d74dbe4fe5 /src | |
parent | 69135691415c67e597cb7840866cce0c722d2aa9 (diff) | |
download | jalv-fde74494c925cc5323d201972722aed6f4849506.tar.gz jalv-fde74494c925cc5323d201972722aed6f4849506.tar.bz2 jalv-fde74494c925cc5323d201972722aed6f4849506.zip |
Avoid NULL dereference in JACK backend on startup failure
Without this, there is a segmentation fault when the initialization of Jalv
fails and it exits before the backend was initialized.
Diffstat (limited to 'src')
-rw-r--r-- | src/jack.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -388,9 +388,11 @@ jalv_backend_init(Jalv* jalv) void jalv_backend_close(Jalv* jalv) { - jack_client_close(jalv->backend->client); - free(jalv->backend); - jalv->backend = NULL; + if (!jalv->backend) { + jack_client_close(jalv->backend->client); + free(jalv->backend); + jalv->backend = NULL; + } } void @@ -402,7 +404,9 @@ jalv_backend_activate(Jalv* jalv) void jalv_backend_deactivate(Jalv* jalv) { - jack_deactivate(jalv->backend->client); + if (jalv->backend) { + jack_deactivate(jalv->backend->client); + } } void |