use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23302 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -176,7 +176,7 @@ krb5_parse_name_flags(krb5_context context,
|
||||
}
|
||||
comp = calloc(ncomp, sizeof(*comp));
|
||||
if (comp == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ krb5_parse_name_flags(krb5_context context,
|
||||
p = start = q = s = strdup(name);
|
||||
if (start == NULL) {
|
||||
free (comp);
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
while(*p){
|
||||
@@ -217,8 +217,8 @@ krb5_parse_name_flags(krb5_context context,
|
||||
}else{
|
||||
comp[n] = malloc(q - start + 1);
|
||||
if (comp[n] == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
goto exit;
|
||||
}
|
||||
memcpy(comp[n], start, q - start);
|
||||
@@ -247,8 +247,8 @@ krb5_parse_name_flags(krb5_context context,
|
||||
}
|
||||
realm = malloc(q - start + 1);
|
||||
if (realm == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
goto exit;
|
||||
}
|
||||
memcpy(realm, start, q - start);
|
||||
@@ -269,8 +269,8 @@ krb5_parse_name_flags(krb5_context context,
|
||||
|
||||
comp[n] = malloc(q - start + 1);
|
||||
if (comp[n] == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
goto exit;
|
||||
}
|
||||
memcpy(comp[n], start, q - start);
|
||||
@@ -279,8 +279,8 @@ krb5_parse_name_flags(krb5_context context,
|
||||
}
|
||||
*principal = malloc(sizeof(**principal));
|
||||
if (*principal == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_message(context, ret, "malloc: out of memory");
|
||||
goto exit;
|
||||
}
|
||||
if (enterprise)
|
||||
@@ -446,7 +446,7 @@ unparse_name(krb5_context context,
|
||||
len++; /* '\0' */
|
||||
*name = malloc(len);
|
||||
if(*name == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
ret = unparse_name_fixed(context, principal, *name, len, flags);
|
||||
@@ -553,13 +553,13 @@ append_component(krb5_context context, krb5_principal p,
|
||||
|
||||
tmp = realloc(princ_comp(p), (len + 1) * sizeof(*tmp));
|
||||
if(tmp == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
princ_comp(p) = tmp;
|
||||
princ_ncomp(p, len) = malloc(comp_len + 1);
|
||||
if (princ_ncomp(p, len) == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
memcpy (princ_ncomp(p, len), comp, comp_len);
|
||||
@@ -607,7 +607,7 @@ build_principal(krb5_context context,
|
||||
|
||||
p = calloc(1, sizeof(*p));
|
||||
if (p == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
princ_type(p) = KRB5_NT_PRINCIPAL;
|
||||
@@ -615,7 +615,7 @@ build_principal(krb5_context context,
|
||||
princ_realm(p) = strdup(realm);
|
||||
if(p->realm == NULL){
|
||||
free(p);
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
@@ -691,12 +691,12 @@ krb5_copy_principal(krb5_context context,
|
||||
{
|
||||
krb5_principal p = malloc(sizeof(*p));
|
||||
if (p == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
if(copy_Principal(inprinc, p)) {
|
||||
free(p);
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
*outprinc = p;
|
||||
@@ -941,7 +941,7 @@ krb5_425_conv_principal_ext2(krb5_context context,
|
||||
#endif
|
||||
if (passed) {
|
||||
if (inst == NULL) {
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
strlwr(inst);
|
||||
|
Reference in New Issue
Block a user