From a7433275554adb3dd2311c07b5881157fd17457b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 24 Oct 2015 22:20:06 -0400 Subject: add missing 'close $fh', don't print $httpstatusline if there isn't one --- sbosrcarch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbosrcarch b/sbosrcarch index 777f2c3..c246673 100755 --- a/sbosrcarch +++ b/sbosrcarch @@ -612,6 +612,7 @@ sub curl_download_http { while(<$fh>) { print "! $_"; } + close $fh; return undef; # connection refused, DNS lookup failed, etc } @@ -650,6 +651,7 @@ sub curl_download_http { while(<$fh>) { print " ! $_"; } + close $fh; } open $fh, "<$outfile.hdr"; @@ -658,11 +660,12 @@ sub curl_download_http { next unless /^HTTP\/\S+\s+(\d+)/; $httpstatusline = $_, $httpstatus = $1; } + close $fh; unlink($outfile); unlink("$outfile.hdr"); - if($httpstatus ne "200") { + if(defined $httpstatus && ($httpstatus ne "200")) { print "! $httpstatusline\n"; unlink $filename; return undef; -- cgit v1.2.3