dovecot-2.2: auth: Fixed crash if LDAP query returned multiple r...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 21 17:09:43 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/0e324209d885
changeset: 16382:0e324209d885
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 21 17:09:37 2013 +0300
description:
auth: Fixed crash if LDAP query returned multiple results.

diffstat:

 src/auth/db-ldap.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r e0156c479a12 -r 0e324209d885 src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Mon May 20 18:26:16 2013 +0300
+++ b/src/auth/db-ldap.c	Tue May 21 17:09:37 2013 +0300
@@ -825,8 +825,10 @@
 
 		if (srequest->result == res)
 			res = NULL;
-		if (srequest->result != NULL)
+		if (srequest->result != NULL) {
 			ldap_msgfree(srequest->result);
+			srequest->result = NULL;
+		}
 
 		if (array_is_created(&srequest->named_results)) {
 			array_foreach(&srequest->named_results, named_res) {
@@ -835,6 +837,7 @@
 				if (named_res->result != NULL)
 					ldap_msgfree(named_res->result);
 			}
+			array_clear(&srequest->named_results);
 		}
 	}
 	if (res != NULL)


More information about the dovecot-cvs mailing list