From 35e977156c779a1405a7eadba794fb45fb41f625 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 25 Nov 2020 11:46:05 +0100 Subject: [PATCH] s3:spoolssd: Fix creating binding string for error message Found by covscan. Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlett --- source3/printing/spoolssd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c index bf10b19e4a0..babec72e299 100644 --- a/source3/printing/spoolssd.c +++ b/source3/printing/spoolssd.c @@ -611,8 +611,11 @@ static NTSTATUS spoolssd_create_sockets(struct tevent_context *ev_ctx, for (i = 0; i < *listen_fd_size; i++) { rc = listen(listen_fd[i].fd, pf_spoolss_cfg.max_allowed_clients); if (rc == -1) { - char *ep_string = dcerpc_binding_string( - dce_ctx, e->ep_description); + char *ep_string = NULL; + + e = listen_fd[i].fd_data; + ep_string = dcerpc_binding_string(dce_ctx, + e->ep_description); DBG_ERR("Failed to listen on endpoint '%s': %s\n", ep_string, strerror(errno)); status = map_nt_error_from_unix(errno); -- 2.47.3