Use WS_TASK_ALLOC_OBJ()

parent 92566707
......@@ -783,15 +783,15 @@ get_task(VRT_CTX, struct VPFX(pipe_vdp) *obj, const char *method)
priv = VRT_priv_task(ctx, obj);
AN(priv);
if (priv->priv == NULL) {
if ((priv->priv = WS_Alloc(ctx->ws, sizeof(*task))) == NULL) {
WS_TASK_ALLOC_OBJ(ctx, task, PIPE_TASK_MAGIC);
if (task == NULL) {
VDPFAIL(ctx, "%s.%s(): insufficient workspace for "
"task config", obj->name, method);
return (NULL);
}
priv->len = sizeof(*task);
priv->methods = priv_task_methods;
task = (struct task_cfg *)priv->priv;
INIT_OBJ(task, PIPE_TASK_MAGIC);
priv->priv = task;
}
else {
AN(WS_Allocated(ctx->ws, priv->priv, sizeof(*task)));
......@@ -952,12 +952,12 @@ vmod_vdp_setenv(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING var,
VSTAILQ_INIT(task->setenv_head);
}
if ((entry = WS_Alloc(ctx->ws, sizeof(*entry))) == NULL) {
WS_TASK_ALLOC_OBJ(ctx, entry, PIPE_SETENV_MAGIC);
if (entry == NULL) {
VDPFAIL(ctx, "%s.setenv(): insufficient workspace for list "
"entry", obj->name);
return;
}
INIT_OBJ(entry, PIPE_SETENV_MAGIC);
if ((entry->var = WS_Copy(ctx->ws, var, -1)) == NULL) {
VDPFAIL(ctx, "%s.setenv(): insufficient workspace for var",
obj->name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment