add missing patch

This commit is contained in:
jakob 2011-09-17 19:00:22 +00:00
parent ffa5f1c913
commit 87e84d5af2
2 changed files with 32 additions and 2 deletions

View File

@ -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

View File

@ -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;
}