summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-11-15 10:00:52 +0100
committerAndrew Bartlett <abartlet@samba.org>2017-11-28 11:37:06 +0100
commitbfafabfb942668328401a3c89fc55b50dc56c209 (patch)
tree85580abcd1812ed4a6e64bae1465b406a3154a44 /source4/smbd
parentdeaaff6843159f02bb15aeaf457f8af305e40164 (diff)
downloadsamba-bfafabfb942668328401a3c89fc55b50dc56c209.tar.gz
s4:samba: Do not segfault if we run into issues
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index eef0f7bf3d2..f107350e1af 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -105,8 +105,16 @@ static void cleanup_tmp_files(struct loadparm_context *lp_ctx)
{
char *path;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
+ if (mem_ctx == NULL) {
+ exit_daemon("Failed to create memory context",
+ ENOMEM);
+ }
path = smbd_tmp_path(mem_ctx, lp_ctx, NULL);
+ if (path == NULL) {
+ exit_daemon("Failed to cleanup temporary files",
+ EINVAL);
+ }
recursive_delete(path);
talloc_free(mem_ctx);