From f7f3005004a78d5aed7e9f4f480d3b5416330cc9 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 4 Jun 2008 23:36:55 +0000 Subject: [PATCH] close the socket in discover_pingback_server_uri git-svn-id: http://svn.automattic.com/wordpress/trunk@8052 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index bf784f56b3..944fe00677 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1001,18 +1001,22 @@ function discover_pingback_server_uri($url, $timeout_bytes = 2048) { $pingback_server_url_len = $pingback_href_end - $pingback_href_start; $pingback_server_url = substr($contents, $pingback_href_start, $pingback_server_url_len); // We may find rel="pingback" but an incomplete pingback URL - if ( $pingback_server_url_len > 0 ) // We got it! + if ( $pingback_server_url_len > 0 ) { // We got it! + fclose($fp); return $pingback_server_url; + } } $byte_count += strlen($line); if ( $byte_count > $timeout_bytes ) { // It's no use going further, there probably isn't any pingback // server to find in this file. (Prevents loading large files.) + fclose($fp); return false; } } // We didn't find anything. + fclose($fp); return false; }