diff --git a/lib/util/smb_threads.h b/lib/util/smb_threads.h index 9a096167743..67d05b8c411 100644 --- a/lib/util/smb_threads.h +++ b/lib/util/smb_threads.h @@ -119,6 +119,9 @@ static int smb_set_tls_pthread(void *pkey, const void *pval, const char *locatio \ static void *smb_get_tls_pthread(void *pkey, const char *location) \ { \ + if (pkey == NULL) { \ + return NULL; \ + } \ return pthread_getspecific(*(pthread_key_t *)pkey); \ } \ \