ovs-appctl: Fix shadow variable that could cause segfault
authorJustin Pettit <jpettit@nicira.com>
Tue, 17 Nov 2009 00:36:21 +0000 (16:36 -0800)
committerJustin Pettit <jpettit@nicira.com>
Tue, 17 Nov 2009 02:11:39 +0000 (18:11 -0800)
The variable "socket_name" contains the name of the unix domain socket
to be used for communicating with the OVS process.  If the target does
not begin with a "/", the socket name is determined based on a pidfile.
A shadow copy of "socket_name" was kept in the block that looks at the
pidfile, which would cause the function-level one to not be set.  This
removes that shadow copy.

utilities/ovs-appctl.c

index 060e8e286db91c413721d7e67c23e501c547fef0..1302bf2e024439b8f5cdaddb08d39a547d06eace 100644 (file)
@@ -170,7 +170,6 @@ connect_to_target(const char *target)
 
     if (target[0] != '/') {
         char *pidfile_name;
-        char *socket_name;
         pid_t pid;
 
         pidfile_name = xasprintf("%s/%s.pid", ovs_rundir, target);