]> git.proxmox.com Git - mirror_ovs.git/commitdiff
stream-windows: Disconnect faulty named pipes
authorAlin Serdean <aserdean@cloudbasesolutions.com>
Fri, 12 Aug 2016 07:46:40 +0000 (07:46 +0000)
committerGurucharan Shetty <guru@ovn.org>
Tue, 23 Aug 2016 20:25:36 +0000 (13:25 -0700)
Disconnect named pipes that failed connection.

Found by testing.

Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
lib/stream-windows.c

index e0fe012fba0ea7c505b9196b8805f12743b89d12..637920b1087aef80891962ca5edbecbecd1f3155 100644 (file)
@@ -431,6 +431,7 @@ pwindows_accept(struct pstream *pstream, struct stream **new_streamp)
             } else {
                 VLOG_ERR_RL(&rl, "Could not connect named pipe. Last "
                             "error: %s", ovs_lasterror_to_string());
+                DisconnectNamedPipe(p->fd);
                 return EINVAL;
             }
         }
@@ -446,6 +447,7 @@ pwindows_accept(struct pstream *pstream, struct stream **new_streamp)
         } else if (last_error != ERROR_PIPE_CONNECTED) {
             VLOG_ERR_RL(&rl, "Could not connect synchronous named pipe. Last "
                         "error: %s", ovs_lasterror_to_string());
+            DisconnectNamedPipe(p->fd);
             return EINVAL;
         } else {
             /* If the pipe is connected, signal an event. */