From 2a144ea70ed218bd649b9c5ec49e04dbad4b9d71 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Sun, 7 Apr 2019 10:12:02 +1200 Subject: [PATCH] ldb_ldap: trust db_msg_new() to return empty message Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- lib/ldb/ldb_ldap/ldb_ldap.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ldb/ldb_ldap/ldb_ldap.c b/lib/ldb/ldb_ldap/ldb_ldap.c index 29f89388c5f..484b810ac88 100644 --- a/lib/ldb/ldb_ldap/ldb_ldap.c +++ b/lib/ldb/ldb_ldap/ldb_ldap.c @@ -492,7 +492,7 @@ static bool lldb_parse_result(struct lldb_context *ac, LDAPMessage *result) char *errmsgp = NULL; LDAPMessage *msg; int type; - struct ldb_message *ldbmsg; + struct ldb_message *ldbmsg = NULL; char *referral; bool callback_failed; bool request_done; @@ -537,10 +537,6 @@ static bool lldb_parse_result(struct lldb_context *ac, LDAPMessage *result) break; } ldap_memfree(dn); - - ldbmsg->num_elements = 0; - ldbmsg->elements = NULL; - /* loop over all attributes */ for (attr=ldap_first_attribute(lldb->ldap, msg, &berptr); attr; -- 2.47.3