use krb5_set_error_message

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23311 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-06-23 03:30:57 +00:00
parent 32d7980f02
commit 0eac1d3a68

View File

@@ -88,7 +88,7 @@ make_path(krb5_context context, struct tr_realm *r,
break; break;
tmp = calloc(1, sizeof(*tmp)); tmp = calloc(1, sizeof(*tmp));
if(tmp == NULL){ if(tmp == NULL){
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
tmp->next = path; tmp->next = path;
@@ -96,7 +96,7 @@ make_path(krb5_context context, struct tr_realm *r,
path->realm = strdup(p); path->realm = strdup(p);
if(path->realm == NULL){ if(path->realm == NULL){
r->next = path; /* XXX */ r->next = path; /* XXX */
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM;; return ENOMEM;;
} }
} }
@@ -112,7 +112,7 @@ make_path(krb5_context context, struct tr_realm *r,
break; break;
tmp = calloc(1, sizeof(*tmp)); tmp = calloc(1, sizeof(*tmp));
if(tmp == NULL){ if(tmp == NULL){
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
tmp->next = path; tmp->next = path;
@@ -120,7 +120,7 @@ make_path(krb5_context context, struct tr_realm *r,
path->realm = malloc(p - from + 1); path->realm = malloc(p - from + 1);
if(path->realm == NULL){ if(path->realm == NULL){
r->next = path; /* XXX */ r->next = path; /* XXX */
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
memcpy(path->realm, from, p - from); memcpy(path->realm, from, p - from);
@@ -186,7 +186,7 @@ expand_realms(krb5_context context,
tmp = realloc(r->realm, len); tmp = realloc(r->realm, len);
if(tmp == NULL){ if(tmp == NULL){
free_realms(realms); free_realms(realms);
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
r->realm = tmp; r->realm = tmp;
@@ -200,7 +200,7 @@ expand_realms(krb5_context context,
tmp = malloc(len); tmp = malloc(len);
if(tmp == NULL){ if(tmp == NULL){
free_realms(realms); free_realms(realms);
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
strlcpy(tmp, prev_realm, len); strlcpy(tmp, prev_realm, len);
@@ -286,7 +286,7 @@ decode_realms(krb5_context context,
if(tr[i] == ','){ if(tr[i] == ','){
tmp = malloc(tr + i - start + 1); tmp = malloc(tr + i - start + 1);
if(tmp == NULL){ if(tmp == NULL){
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
memcpy(tmp, start, tr + i - start); memcpy(tmp, start, tr + i - start);
@@ -294,7 +294,7 @@ decode_realms(krb5_context context,
r = make_realm(tmp); r = make_realm(tmp);
if(r == NULL){ if(r == NULL){
free_realms(*realms); free_realms(*realms);
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
*realms = append_realm(*realms, r); *realms = append_realm(*realms, r);
@@ -304,7 +304,7 @@ decode_realms(krb5_context context,
tmp = malloc(tr + i - start + 1); tmp = malloc(tr + i - start + 1);
if(tmp == NULL){ if(tmp == NULL){
free(*realms); free(*realms);
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
memcpy(tmp, start, tr + i - start); memcpy(tmp, start, tr + i - start);
@@ -312,7 +312,7 @@ decode_realms(krb5_context context,
r = make_realm(tmp); r = make_realm(tmp);
if(r == NULL){ if(r == NULL){
free_realms(*realms); free_realms(*realms);
krb5_set_error_string (context, "malloc: out of memory"); krb5_set_error_message(context, ENOMEM, "malloc: out of memory");
return ENOMEM; return ENOMEM;
} }
*realms = append_realm(*realms, r); *realms = append_realm(*realms, r);