diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 17bcbcac9d8..926bb8233d7 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -655,7 +655,10 @@ char *alloc_sub_basic(const char *smb_name, const char *domain_name, a_string = realloc_string_sub(a_string, "%h", myhostname()); break; case 'm' : - a_string = realloc_string_sub(a_string, "%m", remote_machine); + a_string = realloc_string_sub(a_string, "%m", + remote_machine + ? remote_machine + : ""); break; case 'v' : a_string = realloc_string_sub(a_string, "%v", SAMBA_VERSION_STRING);