From 38ef0ddd9a3517b255dcb54db8d2e1ed28f1d1ee Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 6 Jun 2020 00:00:08 +0200 Subject: [PATCH] fix: crash if libfuse is not available at runtime --- changelog.md | 1 + lib/webfuse/adapter/impl/session.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index f7af51b..cc9a9dd 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ ### Fixes * Fix meson build failure when gtest or jansson are not installed +* Fix crash if libfuse is not available at runtime ## 0.3.0 _(Fri Jun 05 2020)_ diff --git a/lib/webfuse/adapter/impl/session.c b/lib/webfuse/adapter/impl/session.c index 6bacd10..159f43a 100644 --- a/lib/webfuse/adapter/impl/session.c +++ b/lib/webfuse/adapter/impl/session.c @@ -109,8 +109,11 @@ bool wf_impl_session_add_filesystem( if (result) { struct wf_impl_filesystem * filesystem = wf_impl_filesystem_create(session, name, mountpoint); - wf_slist_append(&session->filesystems, &filesystem->item); result = (NULL != filesystem); + if (result) + { + wf_slist_append(&session->filesystems, &filesystem->item); + } } // cleanup on error