From 10c1b882c6f830151e7592c6e648565d73741445 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 7f653a1d8..0d067d71d 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -1310,7 +1310,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 @@ -1345,8 +1345,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)