summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2015-09-09 20:14:41 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2015-09-09 20:14:41 +0000
commit7ac53cc422902c608239a8719a46b200f4b7d4e1 (patch)
treeb60e17874673131101337c77090412013e0e2114 /sys
parent70523632459a9f193f1664a1fd0e55eafc5dc1bc (diff)
if_put after you if_get
ok mpi@
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/in_pcb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 9043a1def91..e64ed4d1b30 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.175 2015/09/01 21:24:04 bluhm Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.176 2015/09/09 20:14:40 dlg Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -867,10 +867,13 @@ in_selectsrc(struct in_addr **insrc, struct sockaddr_in *sin,
if (ifp != NULL) {
if (ifp->if_rdomain == rtable_l2(rtableid))
IFP_TO_IA(ifp, ia);
- if (ia == NULL)
+ if (ia == NULL) {
+ if_put(ifp);
return (EADDRNOTAVAIL);
+ }
*insrc = &ia->ia_addr.sin_addr;
+ if_put(ifp);
return (0);
}
}