Index: wp-includes/class-http.php
===================================================================
--- wp-includes/class-http.php	(revision 23348)
+++ wp-includes/class-http.php	(working copy)
@@ -1145,6 +1145,14 @@
 		// We don't need to return the body, so don't. Just execute request and return.
 		if ( ! $r['blocking'] ) {
 			curl_exec( $handle );
+			if ( $curl_error = curl_error( $handle ) ) {
+				close( $handle );
+				return new WP_Error( 'http_request_failed', $curl_error );
+			}
+			if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
+				close( $handle );
+				return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
+			}
 			curl_close( $handle );
 			return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
 		}
@@ -1158,10 +1166,14 @@
 
 		// If no response
 		if ( 0 == strlen( $theResponse ) && empty( $theHeaders['headers'] ) ) {
-			if ( $curl_error = curl_error( $handle ) )
+			if ( $curl_error = curl_error( $handle ) ) {
+				close( $handle );
 				return new WP_Error( 'http_request_failed', $curl_error );
-			if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) )
+			}
+			if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
+				close( $handle );
 				return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
+			}
 		}
 
 		$this->headers = '';
