summaryrefslogtreecommitdiffstats
path: root/src/util/support
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-04-30 23:18:21 +0000
committerKen Raeburn <raeburn@mit.edu>2008-04-30 23:18:21 +0000
commitec5b9670de4c7af9ebaecfbd305857ee030460c0 (patch)
treef6bf89e559978a8cea0ee428421ab75dba969381 /src/util/support
parent4fe69e66b424f10e6a44f8bd488e3fa56682edbf (diff)
downloadkrb5-ec5b9670de4c7af9ebaecfbd305857ee030460c0.tar.gz
krb5-ec5b9670de4c7af9ebaecfbd305857ee030460c0.tar.xz
krb5-ec5b9670de4c7af9ebaecfbd305857ee030460c0.zip
After malloc/realloc/calloc failures, return ENOMEM explicitly instead
of reading it from errno. This may make static analysis tools less confused about when we return zero vs nonzero values. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20312 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/support')
-rw-r--r--src/util/support/threads.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/support/threads.c b/src/util/support/threads.c
index 29613fd616..02c14e5de0 100644
--- a/src/util/support/threads.c
+++ b/src/util/support/threads.c
@@ -1,7 +1,7 @@
/*
* 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
@@ -270,7 +270,7 @@ int k5_setspecific (k5_key_t keynum, void *value)
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 */
@@ -290,7 +290,7 @@ int k5_setspecific (k5_key_t keynum, void *value)
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 */
@@ -624,7 +624,7 @@ krb5int_mutex_alloc (k5_mutex_t **m)
ptr = malloc (sizeof (k5_mutex_t));
if (ptr == NULL)
- return errno;
+ return ENOMEM;
err = k5_mutex_init (ptr);
if (err) {
free (ptr);