Fix Coverity ID 537
authorVolker Lendecke <vl@samba.org>
Fri, 21 Mar 2008 10:42:42 +0000 (11:42 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 21 Mar 2008 10:42:42 +0000 (11:42 +0100)
source/lib/substitute.c

index 85c06e93741bc9dac85cf859c6d149cc37c8b9b5..6ecc3fc63596071ad3baf6dda80dd742bfc81fbe 100644 (file)
@@ -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;
 }