1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lejp: allow for no cb on unprepared lejp on destroy

On an error path, we might not have a valid spa / lejp to destroy.
In that case, don't hurl ourselves into calling a
function pointer that can be NULL for the destroy cb.
This commit is contained in:
Andy Green 2021-01-02 06:01:41 +00:00
parent 3ced2a4f90
commit b2898b5bfc

View file

@ -107,7 +107,8 @@ void
lejp_destruct(struct lejp_ctx *ctx)
{
/* no allocations... just let callback know what it happening */
ctx->pst[0].callback(ctx, LEJPCB_DESTRUCTED);
if (ctx->pst[0].callback)
ctx->pst[0].callback(ctx, LEJPCB_DESTRUCTED);
}
/**