Initialize the named_pipe_path in GDBRemoteCommunication::StartDebugserverProcess

right after the space for it is allocated on the stack, instead of trying
to initialize it in all the different places in this method.  It's too easy
for another uninitialized code path to sneak in as it is written right now.

llvm-svn: 200066
This commit is contained in:
Jason Molenda 2014-01-25 03:57:13 +00:00
parent 6b9ee9bce3
commit 6e20554ea8
1 changed files with 1 additions and 7 deletions

View File

@ -669,6 +669,7 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname,
debugserver_args.AppendArgument("--setsid");
char named_pipe_path[PATH_MAX];
named_pipe_path[0] = '\0';
bool listen = false;
if (host_and_port[0])
@ -703,22 +704,15 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *hostname,
debugserver_args.AppendArgument("--named-pipe");
debugserver_args.AppendArgument(named_pipe_path);
}
else
named_pipe_path[0] = '\0';
}
else
named_pipe_path[0] = '\0';
}
else
{
named_pipe_path[0] = '\0';
listen = true;
}
}
else
{
named_pipe_path[0] = '\0';
// No host and port given, so lets listen on our end and make the debugserver
// connect to us..
error = StartListenThread ("localhost", 0);