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:
parent
3ced2a4f90
commit
b2898b5bfc
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue