free child for completeness
if we fail to start the child, then we had pushed a frame in the
parent which is now invalid. So we mark that frame as unwinding
which does little more than reduce maximum memory pressure, as it
was parented from "request"
child = unlang_io_subrequest_alloc(request, gext->dict, UNLANG_DETACHABLE);
if (!child) {
fail:
+ talloc_free(child);
return UNLANG_ACTION_FAIL;
}
/*
* This instruction will mark the parent as runnable
* when it executed.
*/
- if (unlang_child_request_init(cr, cr, child, p_result, NULL, unique_session_ptr, free_child) < 0) return -1;
+ if (unlang_child_request_init(cr, cr, child, p_result, NULL, unique_session_ptr, free_child) < 0) {
+ unwind_set(frame);
+ return -1;
+ }
return 0;
}