/*
* lib/krb5/krb/compat_recv.c
*
- * Copyright 1993 by the Massachusetts Institute of Technology.
+ * Copyright 1993, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
version->data = malloc (KRB_SENDAUTH_VLEN + 1);
version->data[KRB_SENDAUTH_VLEN] = 0;
if (version->data == 0)
- return errno;
+ return ENOMEM;
retval = krb_v4_recvauth(v4_options, fd, v4_ticket,
v4_service, v4_instance, v4_faddr,
v4_laddr, *v4_kdata, v4_filename,
int chunk_count = 1;
if ( ! ( temp_creds = (krb5_creds **) malloc( CHUNK * sizeof(krb5_creds *)))){
- return errno;
+ return ENOMEM;
}
chunk_count ++;
if (!(temp_creds = (krb5_creds **) realloc(temp_creds,
chunk_count * CHUNK * sizeof(krb5_creds *)))){
- return errno;
+ return ENOMEM;
}
}
}
/* check each line */
- if( !(linebuf = (char *) calloc (BUFSIZ, sizeof(char)))) return errno;
+ if( !(linebuf = (char *) calloc (BUFSIZ, sizeof(char)))) return ENOMEM;
- if (!(buf_out = (char **) malloc( CHUNK * sizeof(char *)))) return errno;
+ if (!(buf_out = (char **) malloc( CHUNK * sizeof(char *)))) return ENOMEM;
while ( fgets(linebuf, BUFSIZ, fp) != NULL) {
/* null-terminate the input string */
chunk_count ++;
if (!(buf_out = (char **) realloc(buf_out,
chunk_count * CHUNK * sizeof(char *)))){
- return errno;
+ return ENOMEM;
}
}
if (!newline)
while (((gobble = getc(fp)) != EOF) && gobble != '\n');
- if( !(linebuf = (char *) calloc (BUFSIZ, sizeof(char)))) return errno;
+ if( !(linebuf = (char *) calloc (BUFSIZ, sizeof(char)))) return ENOMEM;
}
buf_out[count] = NULL;
int count = 0, chunk_count = 1;
if (!(temp_list = (char **) malloc( CHUNK * sizeof(char *))))
- return errno;
+ return ENOMEM;
retval = get_line(fp, &line);
if (retval)
chunk_count ++;
if (!(temp_list = (char **) realloc(temp_list,
chunk_count * CHUNK * sizeof(char *)))){
- return errno;
+ return ENOMEM;
}
}
while (list2[c2]) c2++;
if (!(tlist = (char **) calloc( c1 + c2 + 1, sizeof ( char *))))
- return errno;
+ return ENOMEM;
i = 0;
while(list1[i]) {
}
if (! (temp_filt_list = (char **) calloc(found_count +1, sizeof (char*))))
- return errno;
+ return ENOMEM;
for(j= 0, k=0; j < i; j++ ) {
if (k5users_list[j]){
int size = pargc - *optindex + 2;
if ((ret_params = (char **) calloc(size, sizeof (char *)))== NULL ){
- return errno;
+ return ENOMEM;
}
for (i = *optindex, j=1; i < pargc; i++,j++){
/*
* lib/crypto/des/des_s2k.c
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
a byte array, not a string. */
copy = malloc(copylen);
if (copy == NULL)
- return errno;
+ return ENOMEM;
memcpy(copy, pw->data, pw->length);
if (salt)
memcpy(copy + pw->length, salt->data, salt->length);
tmp.length = hashsize;
tmp.data = malloc(hashsize);
if (tmp.data == NULL)
- return errno;
+ return ENOMEM;
ret = krb5_hmac(hash, ki, num, input, &tmp);
if (ret == 0)
memcpy(output->data, tmp.data, output->length);
/*
* lib/crypto/pbkdf2.c
*
- * Copyright 2002 by the Massachusetts Institute of Technology.
+ * Copyright 2002, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
utmp1 = /*output + dklen; */ malloc(hlen);
if (utmp1 == NULL)
- return errno;
+ return ENOMEM;
utmp2 = /*utmp1 + hlen; */ malloc(salt->length + 4 + hlen);
if (utmp2 == NULL) {
free(utmp1);
- return errno;
+ return ENOMEM;
}
/* Step 3. */
/*
* lib/kadm/alt_prof.c
*
- * Copyright 1995,2001 by the Massachusetts Institute of Technology.
+ * Copyright 1995,2001,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
profile_path = malloc(2 + krb5_config_len + kdc_config_len);
if (profile_path == NULL) {
krb5_free_config_files(filenames);
- return errno;
+ return ENOMEM;
}
if (kdc_config_len)
strcpy(profile_path, kdc_config);
return errno;
}
if ((word_block = (char *) malloc(sb.st_size + 1)) == NULL)
- return errno;
+ return ENOMEM;
if (read(fd, word_block, sb.st_size) != sb.st_size)
return errno;
(void) close(fd);
word_count++;
}
if ((word_list = (char **) malloc(word_count * sizeof(char *))) == NULL)
- return errno;
+ return ENOMEM;
p = word_block;
for (i = 0; i < word_count; i++) {
word_list[i] = p;
/*
* lib/krb5/ccache/cc_memory.c
*
- * Copyright 1990,1991,2000,2004 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2000,2004,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
new_node = malloc(sizeof(krb5_mcc_link));
if (new_node == NULL)
- return errno;
+ return ENOMEM;
err = krb5_copy_creds(ctx, creds, &new_node->creds);
if (err) {
free(new_node);
/*
* lib/krb5/os/hostaddr.c
*
- * Copyright 1990,1991 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
addrs = malloc ((i+1) * sizeof(*addrs));
if (!addrs)
- return errno;
+ return ENOMEM;
for (j = 0; j < i + 1; j++)
addrs[j] = 0;
/*
* lib/krb5/os/init_ctx.c
*
- * Copyright 1994, 2007 by the Massachusetts Institute of Technology.
+ * Copyright 1994, 2007, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
count += 2;
newfiles = malloc(count * sizeof(*newfiles));
if (newfiles == NULL)
- return errno;
+ return ENOMEM;
memcpy(newfiles + 1, *pfiles, (count-1) * sizeof(*newfiles));
newfiles[0] = strdup(file);
if (newfiles[0] == NULL) {
/*
* lib/krb5/os/localaddr.c
*
- * Copyright 1990,1991,2000,2001,2002,2004,2007 by the Massachusetts Institute of Technology.
+ * Copyright 1990,1991,2000,2001,2002,2004,2007,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
current_buf_size = est_ifreq_size * est_if_count + SLOP;
buf = malloc (current_buf_size);
if (buf == NULL)
- return errno;
+ return ENOMEM;
ask_again:
size = current_buf_size;
new_size = est_ifreq_size * est_if_count + SLOP;
buf = grow_or_free (buf, new_size);
if (buf == 0)
- return errno;
+ return ENOMEM;
current_buf_size = new_size;
goto ask_again;
}
/*
* lib/krb5/os/locate_kdc.c
*
- * Copyright 1990,2000,2001,2002,2003,2004,2006 Massachusetts Institute of Technology.
+ * Copyright 1990,2000,2001,2002,2003,2004,2006,2008 Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
newaddrs = realloc (lp->addrs, newsize);
if (newaddrs == NULL)
- return errno;
+ return ENOMEM;
lp->addrs = newaddrs;
for (i = lp->space; i < newspace; i++) {
lp->addrs[i].ai = NULL;
/*
- * Copyright 1997,2000,2001,2004 by Massachusetts Institute of Technology
+ * Copyright 1997,2000,2001,2004,2008 by Massachusetts Institute of Technology
*
* Copyright 1987, 1988 by MIT Student Information Processing Board
*
del = (struct dynamic_et_list *)malloc(sizeof(struct dynamic_et_list));
if (del == NULL)
- return errno;
+ return ENOMEM;
del->table = et;
/*
- * Copyright 1997 by Massachusetts Institute of Technology
+ * Copyright 1997, 2008 by Massachusetts Institute of Technology
*
* Copyright 1986, 1987, 1988 by MIT Student Information Processing Board
*
new_et = (struct foobar *) malloc(sizeof(struct foobar));
if (!new_et)
- return errno; /* oops */
+ return ENOMEM; /* oops */
new_et->etl.table = &new_et->et;
new_et->et.msgs = msgs;
new_et->et.base = base;
expanded_filename = malloc(len);
if (expanded_filename == 0) {
free(prf);
- return errno;
+ return ENOMEM;
}
if (home_env) {
strcpy(expanded_filename, home_env);
COUNT_LINKED_LIST (size, prf_file_t, old_profile->first_file, next);
files = malloc ((size+1) * sizeof(*files));
if (files == NULL)
- return errno;
+ return ENOMEM;
for (i = 0, file = old_profile->first_file; i < size; i++, file = file->next)
files[i] = file->data->filespec;
files[size] = NULL;
%{
/*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
it = malloc(sizeof(*it));
if (it == NULL)
- return errno;
+ return ENOMEM;
{
/* Memory leak!
for (count = 0; nullterm[count]; count++) ;
args = calloc(count+1, sizeof(char *));
if (args == NULL)
- return errno;
+ return ENOMEM;
for (j = 0; j < count; j++) {
args[j] = strdup(nullterm[j]);
if (args[j] == NULL)
- return errno;
+ return ENOMEM;
}
args[j] = NULL;
}
it = malloc(sizeof(*it));
if (it == NULL)
- return errno;
+ return ENOMEM;
{
/* Memory leak!
for (count = 0; nullterm[count]; count++) ;
args = calloc(count+1, sizeof(char *));
if (args == NULL)
- return errno;
+ return ENOMEM;
for (j = 0; j < count; j++) {
args[j] = strdup(nullterm[j]);
if (args[j] == NULL)
- return errno;
+ return ENOMEM;
}
args[j] = NULL;
}
/*
* util/support/threads.c
*
- * Copyright 2004,2005,2006,2007 by the Massachusetts Institute of Technology.
+ * Copyright 2004,2005,2006,2007,2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
int i;
t = malloc(sizeof(*t));
if (t == NULL)
- return errno;
+ return ENOMEM;
for (i = 0; i < K5_KEY_MAX; i++)
t->values[i] = 0;
/* add to global linked list */
int i;
t = malloc(sizeof(*t));
if (t == NULL)
- return errno;
+ return ENOMEM;
for (i = 0; i < K5_KEY_MAX; i++)
t->values[i] = 0;
/* add to global linked list */
ptr = malloc (sizeof (k5_mutex_t));
if (ptr == NULL)
- return errno;
+ return ENOMEM;
err = k5_mutex_init (ptr);
if (err) {
free (ptr);