(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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user