mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
MINOR: ssl: Remove unnecessary alloc'ed trash chunk in show ocsp-response
When displaying the content of an OCSP response in the CLI, a buffer is alloc'ed when a temporary buffer would be enough.
This commit is contained in:
parent
9334843859
commit
e3d5f9a92b
@ -7921,30 +7921,18 @@ int ssl_get_ocspresponse_detail(unsigned char *ocsp_certid, struct buffer *out)
|
|||||||
*/
|
*/
|
||||||
static int cli_io_handler_show_ocspresponse_detail(struct appctx *appctx)
|
static int cli_io_handler_show_ocspresponse_detail(struct appctx *appctx)
|
||||||
{
|
{
|
||||||
struct buffer *trash = alloc_trash_chunk();
|
struct buffer *trash = get_trash_chunk();
|
||||||
struct certificate_ocsp *ocsp = appctx->svcctx;
|
struct certificate_ocsp *ocsp = appctx->svcctx;
|
||||||
|
|
||||||
if (trash == NULL)
|
if (ssl_ocsp_response_print(&ocsp->response, trash))
|
||||||
return 1;
|
goto end;
|
||||||
|
|
||||||
if (ssl_ocsp_response_print(&ocsp->response, trash)) {
|
|
||||||
free_trash_chunk(trash);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applet_putchk(appctx, trash) == -1)
|
if (applet_putchk(appctx, trash) == -1)
|
||||||
goto yield;
|
return 0;
|
||||||
|
|
||||||
|
end:
|
||||||
appctx->svcctx = NULL;
|
appctx->svcctx = NULL;
|
||||||
if (trash)
|
|
||||||
free_trash_chunk(trash);
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
yield:
|
|
||||||
if (trash)
|
|
||||||
free_trash_chunk(trash);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user