From 02570da5ebdbf459283bc3f9a6b0f2e5b02f0875 Mon Sep 17 00:00:00 2001 From: Operations Research Engineering Software+ Date: Mon, 6 Mar 2017 22:53:37 -0800 Subject: [PATCH] Updated ldapjs Seems like to prevent some memory leaks that this would be the right thing to do (RTD). --- lib/ldapauth.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ldapauth.js b/lib/ldapauth.js index b825fc0..3e28b06 100644 --- a/lib/ldapauth.js +++ b/lib/ldapauth.js @@ -298,12 +298,13 @@ LdapAuth.prototype._findUser = function (username, callback) { result.on('searchEntry', function (entry) { items.push(entry.object); }); - result.on('error', function (err) { + result.once('error', function (err) { self.log && self.log.trace(err, 'ldap authenticate: search error event'); return callback(err); }); - result.on('end', function (result) { + result.once('end', function (result) { + result.removeAllListeners(); if (result.status !== 0) { var err = 'non-zero status from LDAP search: ' + result.status; self.log && self.log.trace(err, 'ldap authenticate');