appctx_free_on_early_error() must be used to release a freshly created frontend appctx if an error occurred during the init stage. It takes care to release the stream instead of the appctx if it exists. For a backend appctx, it just calls appctx_free().