ASPLes / nopoll

OpenSource WebSocket toolkit
http://www.aspl.es/nopoll
GNU Lesser General Public License v2.1
126 stars 73 forks source link

Double mutex unlock in nopoll_ctx_unregister_conn() #21

Closed softins closed 7 years ago

softins commented 7 years ago

In nopoll_ctx_unregister_conn(), line 333 there is a call to nopoll_mutex_unlock (ctx->ref_mutex), followed soon by a break;. The loop being exited is followed by another call to nopoll_mutex_unlock, which will result in a double-unlock.

Should the break; be a return; instead?

francisbrosnan commented 7 years ago

Hi Tony,

Thanks for taking your time for reviewing this and reporting. Certainly, you are right. That should be a "return;", otherwise it will cause another call to nopoll_mutex_unlock.

Applied patch: https://github.com/ASPLes/nopoll/commit/31c6ec4d7a68b06beda0dffcc4136b56a4adcb84

Thanks Tony, Best Regards,