Skip to content

Commit

Permalink
do not assert on WS_Reserve() returning insufficient space
Browse files Browse the repository at this point in the history
  • Loading branch information
nigoroll authored and Guillaume Quintard committed Oct 8, 2019
1 parent dd5aba8 commit a6e6450
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vmod_softpurge.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ vmod_softpurge(VRT_CTX)
oh = ctx->req->objcore->objhead;
CHECK_OBJ_NOTNULL(oh, OBJHEAD_MAGIC);
spc = WS_Reserve(ctx->ws, 0);
assert(spc >= sizeof *ocp);
if (spc < sizeof *ocp) {
WS_Release(ctx->ws, 0);
VRT_fail(ctx, "insufficient workspace");
return;
}

nobj = 0;
ocp = (void*)ctx->ws->f;
Expand Down

0 comments on commit a6e6450

Please sign in to comment.