summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-03-31 12:29:03 -0700
committerJeremy Allison <jra@samba.org>2017-04-17 19:13:07 +0200
commit139793ce06ed5611d3eb37fc09f974265289ec55 (patch)
tree7a0defa1342ba9c4616ed0f26776bb5f2c6c7d1b /source4/smbd
parent1ae7028e47076bee2d779a306b5ecb283a02ac0f (diff)
downloadsamba-139793ce06ed5611d3eb37fc09f974265289ec55.tar.gz
s4: server: Add error return checks for tevent_add_fde, tevent_add_timer.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/server.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index d80a94db785..1e5d57940ce 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -497,23 +497,30 @@ static int binary_smbd_main(const char *binary_name,
}
if (S_ISFIFO(st.st_mode) || S_ISSOCK(st.st_mode)) {
- tevent_add_fd(state->event_ctx,
+ struct tevent_fd *fde = tevent_add_fd(state->event_ctx,
state->event_ctx,
0,
stdin_event_flags,
server_stdin_handler,
state);
+ if (fde == NULL) {
+ exit_daemon("Initializing stdin failed", ENOMEM);
+ }
}
if (max_runtime) {
+ struct tevent_timer *te;
DEBUG(0,("%s PID %d was called with maxruntime %d - "
"current ts %llu\n",
binary_name, (int)getpid(),
max_runtime, (unsigned long long) time(NULL)));
- tevent_add_timer(state->event_ctx, state->event_ctx,
+ te = tevent_add_timer(state->event_ctx, state->event_ctx,
timeval_current_ofs(max_runtime, 0),
max_runtime_handler,
state);
+ if (te == NULL) {
+ exit_daemon("Maxruntime handler failed", ENOMEM);
+ }
}
if (lpcfg_server_role(cmdline_lp_ctx) != ROLE_ACTIVE_DIRECTORY_DC