From ce8f310afd034846ae818293f89fc098bd58366b Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Tue, 17 Mar 2015 10:51:47 +0100 Subject: [PATCH] prevent leaking "error" to global scope --- lib/http_client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http_client.js b/lib/http_client.js index 1578fc7..bfcb8fc 100644 --- a/lib/http_client.js +++ b/lib/http_client.js @@ -115,7 +115,7 @@ client.prototype.request = function(method, path, params, callback){ }); res.on('end', function(){ - error = null; + var error = null; try{ data = JSON.parse(data); }catch(e){} if(data['errors']){ error = data['errors'];