Sebastian Lackner : server: Initialize table-> handles immediately after creation of atom table.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Aug 19 09:56:02 CDT 2015


Module: wine
Branch: master
Commit: 46cba58a987f1c41ceb3056c052fda408d825149
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=46cba58a987f1c41ceb3056c052fda408d825149

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Wed Aug 19 12:04:55 2015 +0200

server: Initialize table->handles immediately after creation of atom table.

When the malloc afterwards fails, release_object() is called.
atom_table_destroy() assumes that table->handles was properly initialized.

---

 server/atom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/atom.c b/server/atom.c
index a124426..0ed4ed5 100644
--- a/server/atom.c
+++ b/server/atom.c
@@ -103,6 +103,7 @@ static struct atom_table *create_table(int entries_count)
     {
         if ((entries_count < MIN_HASH_SIZE) ||
             (entries_count > MAX_HASH_SIZE)) entries_count = HASH_SIZE;
+        table->handles = NULL;
         table->entries_count = entries_count;
         if (!(table->entries = malloc( sizeof(*table->entries) * table->entries_count )))
         {




More information about the wine-cvs mailing list