summaryrefslogtreecommitdiff
path: root/source4/ldap_server
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-05-22 17:10:07 +0200
committerJeremy Allison <jra@samba.org>2018-05-24 03:35:00 +0200
commit291630126d3358c22bc88d98e5e35c274e6af29d (patch)
tree170da6deb940eb7a6d48d7da62a81b5f30e9b33d /source4/ldap_server
parent3aae048a43b1987eb2e60de988a8d4c180bfd6f6 (diff)
downloadsamba-291630126d3358c22bc88d98e5e35c274e6af29d.tar.gz
ldap_server: Fix CID 1435721 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 24 03:35:00 CEST 2018 on sn-devel-144
Diffstat (limited to 'source4/ldap_server')
-rw-r--r--source4/ldap_server/ldap_server.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index 49e03ef8c6f..b5251e3623e 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -104,6 +104,7 @@ static void ldapsrv_terminate_connection_done(struct tevent_req *subreq)
tevent_req_callback_data(subreq,
struct ldapsrv_connection);
int sys_errno;
+ bool ok;
tstream_disconnect_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
@@ -130,9 +131,15 @@ static void ldapsrv_terminate_connection_done(struct tevent_req *subreq)
conn->limits.reason);
return;
}
- tevent_req_set_endtime(subreq,
- conn->connection->event.ctx,
- conn->limits.endtime);
+ ok = tevent_req_set_endtime(subreq,
+ conn->connection->event.ctx,
+ conn->limits.endtime);
+ if (!ok) {
+ TALLOC_FREE(conn->sockets.raw);
+ stream_terminate_connection(conn->connection,
+ conn->limits.reason);
+ return;
+ }
tevent_req_set_callback(subreq, ldapsrv_terminate_connection_done, conn);
}