summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/smbd/process_thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/smbd/process_thread.c b/source4/smbd/process_thread.c
index b79c2f76b5..af111362b2 100644
--- a/source4/smbd/process_thread.c
+++ b/source4/smbd/process_thread.c
@@ -405,9 +405,10 @@ static uint32_t thread_get_task_id(void)
static void thread_log_task_id(int fd)
{
- char *s;
+ char *s= NULL;
asprintf(&s, "thread %u: ", (uint32_t)pthread_self());
+ if (!s) return;
write(fd, s, strlen(s));
free(s);
}