--- source4/libcli/ldap/ldap_client.c 2020-07-09 09:33:56 UTC +++ source4/libcli/ldap/ldap_client.c @@ -336,7 +336,7 @@ uint16_t *pport) /* Not set for ldapi */ { enum ldap_proto proto = LDAP_PROTO_NONE; - char *host = NULL; + char host[1025]; int ret, port; if (url == NULL) { @@ -403,13 +403,12 @@ return 0; } - ret = sscanf(url, "%m[^:/]:%d", &host, &port); + ret = sscanf(url, "%254[^:/]:%d", host, &port); if (ret < 1) { return EINVAL; } *pdest = talloc_strdup(mem_ctx, host); - SAFE_FREE(host); if (*pdest == NULL) { return ENOMEM; }