← Commit list

0343951cb5

Andrew
Andrew
2026-01-05
SUCCESS Duration: 510s

Subject

ldap: fix `Curl_ldap_version()` for IBMi/OS400

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/ldap.c+7 -1
@@ -1022,7 +1022,9 @@ void Curl_ldap_version(char *buf, size_t bufsz)
LDAPAPIInfo api;
api.ldapai_info_version = LDAP_API_INFO_VERSION;
- if(ldap_get_option(NULL, LDAP_OPT_API_INFO, &api) == LDAP_OPT_SUCCESS) {
+ /* Comparing against 0, as different platforms
+ disagree on the success define name */
+ if(ldap_get_option(NULL, LDAP_OPT_API_INFO, &api) == 0) {
unsigned int patch = (unsigned int)(api.ldapai_vendor_version % 100);
unsigned int major = (unsigned int)(api.ldapai_vendor_version / 10000);
unsigned int minor =
@@ -1030,8 +1032,12 @@ void Curl_ldap_version(char *buf, size_t bufsz)
- patch) / 100;
curl_msnprintf(buf, bufsz, "%s/%u.%u.%u%s",
api.ldapai_vendor_name, major, minor, patch, flavor);
+#ifdef __OS400__
+ ldap_value_free(api.ldapai_extensions);
+#else
ldap_memfree(api.ldapai_vendor_name);
ber_memvfree((void **)api.ldapai_extensions);
+#endif
}
else
curl_msnprintf(buf, bufsz, "LDAP/1");