diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/port-net.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openbsd-compat/port-net.c b/openbsd-compat/port-net.c index 7050629c3..bb535626f 100644 --- a/openbsd-compat/port-net.c +++ b/openbsd-compat/port-net.c | |||
@@ -185,7 +185,7 @@ sys_tun_open(int tun, int mode, char **ifname) | |||
185 | else | 185 | else |
186 | debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); | 186 | debug("%s: %s mode %d fd %d", __func__, ifr.ifr_name, mode, fd); |
187 | 187 | ||
188 | if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) | 188 | if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) |
189 | goto failed; | 189 | goto failed; |
190 | 190 | ||
191 | return (fd); | 191 | return (fd); |
@@ -272,7 +272,7 @@ sys_tun_open(int tun, int mode, char **ifname) | |||
272 | goto failed; | 272 | goto failed; |
273 | } | 273 | } |
274 | 274 | ||
275 | if (ifname != NULL && (*ifname = strdup(ifr.ifr_name))) | 275 | if (ifname != NULL && (*ifname = strdup(ifr.ifr_name)) == NULL) |
276 | goto failed; | 276 | goto failed; |
277 | 277 | ||
278 | close(sock); | 278 | close(sock); |