summaryrefslogtreecommitdiff
path: root/src/util/Table.c
diff options
context:
space:
mode:
authorjthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-03-26 17:33:44 +0000
committerjthorn <jthorn@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-03-26 17:33:44 +0000
commit91f2d7285a268d823f48e66ca4755815cf4f968f (patch)
tree1a1a975d7f44a1ae7992618825dd34a35bae9af8 /src/util/Table.c
parente99ae52b31082c6b24acd7aa42c54cace4e9db35 (diff)
add comment explaining last commit :)
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3604 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/Table.c')
-rw-r--r--src/util/Table.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/Table.c b/src/util/Table.c
index 6fce9462..87050078 100644
--- a/src/util/Table.c
+++ b/src/util/Table.c
@@ -4993,6 +4993,12 @@ static
#endif
{
void *const buffer = malloc(sizeof_value);
+ /*
+ * A 0-sized array is (or should be) legal for the table routines.
+ * Alas, on some systems malloc(0) returns a NULL pointer, so we must
+ * specially check for a 0-sized array in this next test to avoid
+ * falsely seeing this as "malloc failed -- we're out of memory".
+ */
if (sizeof_value != 0 && buffer == NULL)
{
free(tep->key);