diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 225d8b1..7637dc0 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -4129,6 +4129,7 @@
             {
                 msg(M_INFO, "GetPerAdapterInfo #2 failed (status=%lu) : %s", status,
                     strerror_win32(status, gc));
+                pi = NULL;
             }
         }
     }
@@ -4158,6 +4159,7 @@
         {
             msg(M_INFO, "GetInterfaceInfo #2 failed (status=%lu) : %s", status,
                 strerror_win32(status, gc));
+            ii = NULL;
         }
     }
     return ii;
