diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c index 85c06e93741..6ecc3fc6359 100644 --- a/source3/lib/substitute.c +++ b/source3/lib/substitute.c @@ -483,6 +483,9 @@ static const char *automount_server(const char *user_name) return ""; } srv = talloc_strdup(ctx, automount_value); + if (!srv) { + return ""; + } p = strchr_m(srv, ':'); if (!p) { return ""; @@ -494,9 +497,6 @@ static const char *automount_server(const char *user_name) } #endif - if (!server_name) { - server_name = ""; - } DEBUG(4,("Home server: %s\n", server_name)); return server_name; }