From baccd5b238c3701c35e924001f9ff1b5268e3c59 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 14 Mar 2021 12:18:33 +0000 Subject: [PATCH] ss: make sure pointer to failed ss creation is wiped out --- lib/secure-streams/secure-streams.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index 47736e39d..4dce242b4 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -1024,9 +1024,14 @@ lws_ss_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi, #if defined(LWS_WITH_SERVER) || defined(LWS_WITH_SYS_SMD) late_bail: #endif + + if (ppss) + *ppss = NULL; + lws_pt_lock(pt, __func__); lws_dll2_remove(&h->list); lws_pt_unlock(pt); + __lws_lc_untag(&h->lc); lws_free(h);