summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 06:11:30 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-06-03 06:11:30 +0000
commit4daea919c3aa104b6caf8c0f42f49ae755545986 (patch)
tree607453f571a3451c6ba5188e010be900e6bffa1e /src
parent19855d6e09aa36db7686ad6f538179bf87e9c6ea (diff)
Always initialize atomTable to NULL, so xpmHashTableFree() doesn't try to
free a random value from the stack if xpmHashTableInit returns an error.
Diffstat (limited to 'src')
-rw-r--r--src/hashtab.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/hashtab.c b/src/hashtab.c
index d2383a4..84f5e25 100644
--- a/src/hashtab.c
+++ b/src/hashtab.c
@@ -209,6 +209,7 @@ xpmHashTableInit(table)
table->size = INITIAL_HASH_SIZE;
table->limit = table->size / 3;
table->used = 0;
+ table->atomTable = NULL;
if (table->size >= UINT_MAX / sizeof(*atomTable))
return (XpmNoMemory);
atomTable = (xpmHashAtom *) XpmMalloc(table->size * sizeof(*atomTable));