]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:spoolssd: Fix creating binding string for error message
authorAndreas Schneider <asn@samba.org>
Wed, 25 Nov 2020 10:46:05 +0000 (11:46 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 26 Nov 2020 09:44:42 +0000 (09:44 +0000)
Found by covscan.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/printing/spoolssd.c

index bf10b19e4a058073532dfecea01ca208520d54e4..babec72e299c3efd13d3bfd34fd3b33d57bcb4bb 100644 (file)
@@ -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);