/*
* kdc/network.c
*
- * Copyright 1990,2000,2007 by the Massachusetts Institute of Technology.
+ * Copyright 1990,2000,2007,2008 by the Massachusetts Institute of Technology.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
}
newconn = malloc(sizeof(*newconn));
if (newconn == 0) {
- data->retval = errno;
- com_err(data->prog, errno,
+ data->retval = ENOMEM;
+ com_err(data->prog, ENOMEM,
"cannot allocate storage for connection info");
return 0;
}
if (!ADD(connections, newconn, tmp)) {
- data->retval = errno;
- com_err(data->prog, data->retval, "cannot save socket info");
+ data->retval = ENOMEM;
+ com_err(data->prog, ENOMEM, "cannot save socket info");
free(newconn);
return 0;
}
/*
- * Copyright (C) 2002, 2007 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2002, 2007, 2008 by the Massachusetts Institute of Technology.
* All rights reserved.
*
* Export of this software from the United States of America may
memcpy(key->contents, entry.key.contents, key->length);
else if (key->length) {
/* out of memory? */
- ret = errno;
+ ret = ENOMEM;
memset (key, 0, sizeof (*key));
return ret;
}
if (kg_ccache_name != NULL) {
name = strdup(kg_ccache_name);
if (name == NULL)
- err = errno;
+ err = ENOMEM;
} else {
krb5_context context = NULL;
if (name) {
name = strdup(name);
if (name == NULL)
- err = errno;
+ err = ENOMEM;
}
}
if (err && context)
if (!ret) {
pstring = malloc ((princ->length + 1) * sizeof (char));
- if (pstring == NULL) { ret = errno; }
+ if (pstring == NULL) { ret = ENOMEM; }
}
if (!ret) {
/*
- * Copyright 2006 by the Massachusetts Institute of Technology.
+ * Copyright 2006, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
path = calloc(ndx + db_dl_n_locations, sizeof (char *));
if (path == NULL) {
- status = errno;
+ status = ENOMEM;
goto clean_n_exit;
}
if (ndx)
/*
* lib/krb5/os/changepw.c
*
- * Copyright 1990,1999,2001 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1999,2001,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
local_kaddr.length = addrs[0]->length;
local_kaddr.contents = malloc(addrs[0]->length);
if (local_kaddr.contents == NULL && addrs[0]->length != 0) {
- code = errno;
+ code = ENOMEM;
krb5_free_addresses(ctx->context, addrs);
goto cleanup;
}
memcpy(newfiles + 1, *pfiles, (count-1) * sizeof(*newfiles));
newfiles[0] = strdup(file);
if (newfiles[0] == NULL) {
- int e = errno;
+ int e = ENOMEM;
free(newfiles);
return e;
}
P.buf_size = P.lifnum.lifn_count * sizeof (struct lifreq) * 2;
P.buf = malloc (P.buf_size);
if (P.buf == NULL) {
- retval = errno;
+ retval = ENOMEM;
goto punt;
}
P.buf_size = P.if_num * sizeof (struct if_laddrreq) * 2;
P.buf = malloc (P.buf_size);
if (P.buf == NULL) {
- retval = errno;
+ retval = ENOMEM;
goto punt;
}
/*
* lib/krb5/os/sendto_kdc.c
*
- * Copyright 1990,1991,2001,2002,2004,2005,2007 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2001,2002,2004,2005,2007,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
conn->x.in.buf);
if (conn->x.in.buf == 0) {
/* allocation failure */
- e = errno;
+ e = ENOMEM;
goto kill_conn;
}
}
/*
* util/support/plugins.c
*
- * Copyright 2006 by the Massachusetts Institute of Technology.
+ * Copyright 2006, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
if (!err) {
htmp = calloc (1, sizeof (*htmp)); /* calloc initializes ptrs to NULL */
- if (htmp == NULL) { err = errno; }
+ if (htmp == NULL) { err = ENOMEM; }
}
#if USE_DLOPEN
long err = 0;
*harray = calloc (1, sizeof (**harray)); /* calloc initializes to NULL */
- if (*harray == NULL) { err = errno; }
+ if (*harray == NULL) { err = ENOMEM; }
return err;
}
newharray = realloc (*harray, ((newcount + 1) * sizeof (**harray))); /* +1 for NULL */
if (newharray == NULL) {
- err = errno;
+ err = ENOMEM;
} else {
newharray[newcount - 1] = p;
newharray[newcount] = NULL;
for (i = 0; filebases[i]; i++) { bases_count++; }
for (i = 0; fileexts[i]; i++) { exts_count++; }
tempnames = calloc ((bases_count * exts_count)+1, sizeof (char *));
- if (!tempnames) { err = errno; }
+ if (!tempnames) { err = ENOMEM; }
}
if (!err) {
if (asprintf(&tempnames[(i*exts_count)+j], "%s%s",
filebases[i], fileexts[j]) < 0) {
tempnames[(i*exts_count)+j] = NULL;
- err = errno;
+ err = ENOMEM;
}
}
}
if (!err) {
if (asprintf(&filepath, "%s/%s", dirnames[i], filenames[j]) < 0) {
filepath = NULL;
- err = errno;
+ err = ENOMEM;
}
}
int len = NAMELEN (d);
if (asprintf(&filepath, "%s/%*s", dirnames[i], len, d->d_name) < 0) {
filepath = NULL;
- err = errno;
+ err = ENOMEM;
}
}
if (!err) {
p = calloc (1, sizeof (*p)); /* calloc initializes to NULL */
- if (p == NULL) { err = errno; }
+ if (p == NULL) { err = ENOMEM; }
}
if (!err && (dirhandle != NULL) && (dirhandle->files != NULL)) {
count++;
newp = realloc (p, ((count + 1) * sizeof (*p))); /* +1 for NULL */
if (newp == NULL) {
- err = errno;
+ err = ENOMEM;
} else {
p = newp;
p[count - 1] = sym;
if (!err) {
p = calloc (1, sizeof (*p)); /* calloc initializes to NULL */
- if (p == NULL) { err = errno; }
+ if (p == NULL) { err = ENOMEM; }
}
if (!err && (dirhandle != NULL) && (dirhandle->files != NULL)) {
count++;
newp = realloc (p, ((count + 1) * sizeof (*p))); /* +1 for NULL */
if (newp == NULL) {
- err = errno;
+ err = ENOMEM;
} else {
p = newp;
p[count - 1] = sym;