summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/krb5/krbhst.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/heimdal/lib/krb5/krbhst.c')
-rw-r--r--source4/heimdal/lib/krb5/krbhst.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/heimdal/lib/krb5/krbhst.c b/source4/heimdal/lib/krb5/krbhst.c
index ec0c8b738e..d8646f0537 100644
--- a/source4/heimdal/lib/krb5/krbhst.c
+++ b/source4/heimdal/lib/krb5/krbhst.c
@@ -481,7 +481,7 @@ static krb5_error_code
fallback_get_hosts(krb5_context context, struct krb5_krbhst_data *kd,
const char *serv_string, int port, int proto)
{
- char *host;
+ char *host = NULL;
int ret;
struct addrinfo *ai;
struct addrinfo hints;
@@ -500,12 +500,12 @@ fallback_get_hosts(krb5_context context, struct krb5_krbhst_data *kd,
}
if(kd->fallback_count == 0)
- asprintf(&host, "%s.%s.", serv_string, kd->realm);
+ ret = asprintf(&host, "%s.%s.", serv_string, kd->realm);
else
- asprintf(&host, "%s-%d.%s.",
- serv_string, kd->fallback_count, kd->realm);
+ ret = asprintf(&host, "%s-%d.%s.",
+ serv_string, kd->fallback_count, kd->realm);
- if (host == NULL)
+ if (ret < 0 || host == NULL)
return ENOMEM;
make_hints(&hints, proto);