return resp;
}
-static BIO *OSSL_HTTP_REQ_CTX_transfer(OSSL_HTTP_REQ_CTX *rctx)
+static BIO *ossl_http_req_ctx_transfer(OSSL_HTTP_REQ_CTX *rctx)
{
int sending = 1;
int rv;
}
return NULL;
}
- if (!BIO_up_ref(rctx->mem))
- return NULL;
return rctx->mem;
}
ERR_raise(ERR_LIB_HTTP, ERR_R_PASSED_NULL_PARAMETER);
return NULL;
}
- return BIO_mem_d2i(OSSL_HTTP_REQ_CTX_transfer(rctx), it);
+ return BIO_mem_d2i(ossl_http_req_ctx_transfer(rctx), it);
}
static int update_timeout(int timeout, time_t start_time)
if (rctx == NULL)
goto end;
- resp = OSSL_HTTP_REQ_CTX_transfer(rctx);
+ resp = ossl_http_req_ctx_transfer(rctx);
if (resp == NULL) {
if (rctx->redirection_url != NULL) {
if (redirection_url == NULL)
}
}
}
- OSSL_HTTP_REQ_CTX_free(rctx);
-
/* callback can be used to clean up TLS session */
if (bio_update_fn != NULL
- && (*bio_update_fn)(cbio, arg, 0, resp != NULL) == NULL) {
- BIO_free(resp);
+ && (*bio_update_fn)(cbio, arg, 0, resp != NULL) == NULL)
resp = NULL;
- }
+
+ if (resp != NULL && !BIO_up_ref(resp))
+ resp = NULL;
+ OSSL_HTTP_REQ_CTX_free(rctx);
end:
/*