The assumption that WS_Alloc always returns a non-NULL value is not
true, which can lead to the AN(v) following the call to WS_Alloc in
vmod_var to kill the varnish child process, resulting in a loss of the
cache.
Instead of panicking due to a failed assertion, this commit introduces a
check of the return value of WS_Alloc and fails the request in case
not enough memory was available for allocating a new variable.
The assumption that
WS_Alloc
always returns a non-NULL value is not true, which can lead to theAN(v)
following the call toWS_Alloc
invmod_var
to kill the varnish child process, resulting in a loss of the cache.Instead of panicking due to a failed assertion, this commit introduces a check of the return value of
WS_Alloc
and fails the request in case not enough memory was available for allocating a new variable.Follow-up for #196