From 5ea91943785988e9e749ff994eddf48e9ef9bfaa Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 22 Jun 2021 17:01:20 +0100 Subject: [PATCH] ss: check destroy null policy --- lib/secure-streams/secure-streams.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index ada2a7784..740b51a5c 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -1311,7 +1311,7 @@ lws_ss_destroy(lws_ss_handle_t **ppss) */ #if defined(LWS_WITH_SERVER) - if (h->policy->flags & LWSSSPOLF_SERVER) + if (h->policy && (h->policy->flags & LWSSSPOLF_SERVER)) v = lws_get_vhost_by_name(h->context, h->policy->streamtype); #endif @@ -1363,8 +1363,8 @@ lws_ss_destroy(lws_ss_handle_t **ppss) * to the ss connect code instead. */ - - lws_ss_policy_unref_trust_store(h->context, h->policy); + if (h->policy) + lws_ss_policy_unref_trust_store(h->context, h->policy); #endif #if defined(LWS_WITH_SERVER)