summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--src/hashtab.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fd1a686..7217698 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2006-06-02 Alan Coopersmith <alan.coopersmith@sun.com>
+ * src/hashtab.c (xpmHashTableInit):
+ Always initialize atomTable to NULL, so xpmHashTableFree() doesn't
+ try to free a random value from the stack if xpmHashTableInit returns
+ an error.
+
* src/create.c (xpmParseDataAndCreate):
Coverity #1432: Returned without freeing storage "hints_cmt"
(in error case when xpmHashTableInit failed)
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));