]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix assertion when SIGUSR1 is received while getaddrinfo is successful
authorArne Schwabe <arne@rfc2549.org>
Thu, 21 Nov 2013 20:08:05 +0000 (21:08 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 24 Nov 2013 19:23:42 +0000 (20:23 +0100)
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1385064495-25877-4-git-send-email-arne@rfc2549.org>
URL: http://article.gmane.org/gmane.network.openvpn.devel/8019

Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 282788a835f6c9dfb85e8f9a3bd45f5841271b06)

src/openvpn/socket.c

index 85f783af883c122c499d404164c7f3c089bc85bf..708903c9927aa7f57469dfc68bfc687ce43cf69e 100644 (file)
@@ -208,18 +208,20 @@ openvpn_getaddrinfo (unsigned int flags,
               get_signal (signal_received);
               if (*signal_received) /* were we interrupted by a signal? */
                 {
-                  if (0 == status) {
-                    ASSERT(res);
-                    freeaddrinfo(*res);
-                    res = NULL;
-                  }
                   if (*signal_received == SIGUSR1) /* ignore SIGUSR1 */
                     {
                       msg (level, "RESOLVE: Ignored SIGUSR1 signal received during DNS resolution attempt");
                       *signal_received = 0;
                     }
                   else
-                    goto done;
+                    {
+                      if (0 == status) {
+                          ASSERT(res);
+                          freeaddrinfo(*res);
+                          res = NULL;
+                      }
+                      goto done;
+                    }
                 }
             }