From 87e84d5af2ac6f89d6ef2c77013d2ccffa072fc2 Mon Sep 17 00:00:00 2001 From: jakob Date: Sat, 17 Sep 2011 19:00:22 +0000 Subject: [PATCH] add missing patch --- net/ldns/libldns/Makefile | 4 ++-- net/ldns/libldns/patches/patch-net_c | 30 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 net/ldns/libldns/patches/patch-net_c diff --git a/net/ldns/libldns/Makefile b/net/ldns/libldns/Makefile index 67ceeb785b2..32b58b19b0d 100644 --- a/net/ldns/libldns/Makefile +++ b/net/ldns/libldns/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.19 2011/09/17 18:08:03 jakob Exp $ +# $OpenBSD: Makefile,v 1.20 2011/09/17 19:00:22 jakob Exp $ COMMENT= DNS library modelled after Net::DNS PKGNAME= libldns-${VERSION} -REVISION= 0 +REVISION= 1 SHARED_LIBS += ldns 4.8 diff --git a/net/ldns/libldns/patches/patch-net_c b/net/ldns/libldns/patches/patch-net_c new file mode 100644 index 00000000000..900f9104416 --- /dev/null +++ b/net/ldns/libldns/patches/patch-net_c @@ -0,0 +1,30 @@ +$OpenBSD: patch-net_c,v 1.1 2011/09/17 19:00:22 jakob Exp $ + +Fix socket leak on errors. + +--- net.c.orig Thu Jul 14 16:11:57 2011 ++++ net.c Thu Jul 14 16:15:24 2011 +@@ -341,6 +341,11 @@ ldns_udp_bgsend(ldns_buffer *qbin, const struct sockad + } + + if (ldns_udp_send_query(qbin, sockfd, to, tolen) == 0) { ++#ifndef USE_WINSOCK ++ close(sockfd); ++#else ++ closesocket(sockfd); ++#endif + return 0; + } + return sockfd; +@@ -678,6 +683,11 @@ ldns_tcp_bgsend(ldns_buffer *qbin, const struct sockad + } + + if (ldns_tcp_send_query(qbin, sockfd, to, tolen) == 0) { ++#ifndef USE_WINSOCK ++ close(sockfd); ++#else ++ closesocket(sockfd); ++#endif + return 0; + } +