[claws-mail-cvs-commit] ldapquery.c

Colin Leroy <[email protected]> Tue, 18 Aug 2009 05:45:58 +0000
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /srv/cvs/claws-mail/claws/src
In directory ran:/tmp/cvs-serv3903/src

Modified Files:
      Tag: gtk2
	ldapquery.c 
Log Message:
2009-08-18 [colin]	3.7.2cvs17

	* src/ldapquery.c
		Maybe fix crash on non-existent LDAP server

Index: ldapquery.c
===================================================================
RCS file: /srv/cvs/claws-mail/claws/src/ldapquery.c,v
retrieving revision 1.3.2.32
retrieving revision 1.3.2.33
diff -u -d -r1.3.2.32 -r1.3.2.33
--- ldapquery.c	28 Jul 2009 18:39:46 -0000	1.3.2.32
+++ ldapquery.c	18 Aug 2009 05:45:55 -0000	1.3.2.33
@@ -804,7 +804,7 @@
 static gint ldapqry_search_retrieve( LdapQuery *qry ) {
 	LdapControl *ctl;
 	LDAP *ld;
-	LDAPMessage *result, *e = NULL;
+	LDAPMessage *result = NULL, *e = NULL;
 	char **attribs;
 	gchar *criteria;
 	gboolean searchFlag;
@@ -856,7 +856,7 @@
 	else if( rc == LDAP_SUCCESS ) {
 		searchFlag = TRUE;
 	}
-	else if( rc == LDAP_PARTIAL_RESULTS || ldap_count_entries(ld, result) > 0 ) {
+	else if( rc == LDAP_PARTIAL_RESULTS || (result && ldap_count_entries(ld, result) > 0) ) {
 		searchFlag = TRUE;
 	}
 	else {