}
#endif
+ /*
+ * Initialise server with zero length string to
+ * make code below simpler.
+ */
+ inst->handle_config.server = talloc_strdup(inst, "");
+
/*
* Now iterate over all the 'server' config items
*/
cf_log_err(conf, "Failed recombining URL components");
goto ldap_url_error;
}
- inst->handle_config.server = talloc_asprintf_append(inst->handle_config.server, "%s ", url);
+ inst->handle_config.server = talloc_asprintf_append(inst->handle_config.server,
+ "%s ", url);
free(url);
}
# else
}
inst->handle_config.server = talloc_asprintf_append(inst->handle_config.server, "%s:%i ",
- ldap_url->lud_host ? ldap_url->lud_host : "localhost",
- ldap_url->lud_port);
+ ldap_url->lud_host ? ldap_url->lud_host :
+ "localhost",
+ ldap_url->lud_port);
# endif
/*
* @todo We could set a few other top level
}
if (port == 0) port = LDAP_PORT;
- inst->handle_config.server = talloc_asprintf_append(inst->handle_config.server, "ldap://%.*s:%i ", (int) len, value, port);
+ inst->handle_config.server = talloc_asprintf_append(inst->handle_config.server,
+ "ldap://%.*s:%i ",
+ (int) len, value, port);
#else
/*
* ldap_init takes port, which can be overridden by :port so