- fix: malloc failure from dbus test suite (#124747).
authorjbj <devnull@localhost>
Fri, 11 Jun 2004 19:26:54 +0000 (19:26 +0000)
committerjbj <devnull@localhost>
Fri, 11 Jun 2004 19:26:54 +0000 (19:26 +0000)
CVS patchset: 7309
CVS date: 2004/06/11 19:26:54

expat/lib/xmlparse.c

index 82f67c6..6300722 100644 (file)
@@ -5518,8 +5518,10 @@ lookup(HASH_TABLE *table, KEY name, size_t createSize)
     table->size = (size_t)1 << INIT_POWER;
     tsize = table->size * sizeof(NAMED *);
     table->v = (NAMED **)table->mem->malloc_fcn(tsize);
-    if (!table->v)
+    if (!table->v) {
+      table->size = 0;
       return NULL;
+    }
     memset(table->v, 0, tsize);
     i = hash(name) & ((unsigned long)table->size - 1);
   }