(krb5_copy_host_realm): copy all the strings

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7117 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-10-06 15:02:23 +00:00
parent 95b090b41c
commit 5b0e0abca5

View File

@@ -60,7 +60,12 @@ krb5_copy_host_realm(krb5_context context,
return ENOMEM;
for (i = 0; i < n; ++i)
(*to)[i] = NULL;
for (i = 0, p = from; *p != NULL; ++p, ++i)
(*to)[i] = *p;
for (i = 0, p = from; *p != NULL; ++p, ++i) {
(*to)[i] = strdup(*p);
if ((*to)[i] == NULL) {
krb5_free_host_realm (context, *to);
return ENOMEM;
}
}
return 0;
}