diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 1cb191a..a381fa1 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -4066,35 +4066,34 @@
     swprintf(pipe_name, _countof(pipe_name), L"\\\\.\\pipe\\" _L(PACKAGE) L"%ls\\service",
              service_instance);
 
+    HANDLE pipe = INVALID_HANDLE_VALUE;
+
     static HANDLE blocker = INVALID_HANDLE_VALUE;
     if (blocker == INVALID_HANDLE_VALUE)
     {
         blocker = CreateNamedPipe(pipe_name, flags | FILE_FLAG_FIRST_PIPE_INSTANCE, mode,
                                   PIPE_UNLIMITED_INSTANCES, 1024, 1024, 0, &sa);
-        if (blocker != INVALID_HANDLE_VALUE && !DisconnectNamedPipe(blocker))
+        if (blocker == INVALID_HANDLE_VALUE)
         {
-            DWORD error = GetLastError();
+            MsgToEventLog(M_SYSERR, L"Could not create first instance of named pipe");
+            goto out;
+        }
+        if (!DisconnectNamedPipe(blocker))
+        {
+            MsgToEventLog(M_SYSERR, L"Could not disconnect first instance of named pipe");
             CloseHandleEx(&blocker);
-            SetLastError(error);
+            goto out;
         }
     }
 
-    /* Without the first instance, fail and try again with the next call */
-    HANDLE pipe = INVALID_HANDLE_VALUE;
-    if (blocker != INVALID_HANDLE_VALUE)
-    {
-        pipe = CreateNamedPipe(pipe_name, flags, mode, PIPE_UNLIMITED_INSTANCES, 1024, 1024, 0,
-                               &sa);
-    }
-
-    LocalFree(sd);
-
+    pipe = CreateNamedPipe(pipe_name, flags, mode, PIPE_UNLIMITED_INSTANCES, 1024, 1024, 0, &sa);
     if (pipe == INVALID_HANDLE_VALUE)
     {
         MsgToEventLog(M_SYSERR, L"Could not create named pipe");
-        return INVALID_HANDLE_VALUE;
     }
 
+out:
+    LocalFree(sd);
     return pipe;
 }
 
