Imported Upstream version 2.9.6
[platform/upstream/libxml2.git] / hash.c
diff --git a/hash.c b/hash.c
index 0145109..5dcaeb4 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -168,7 +168,7 @@ xmlHashComputeQKey(xmlHashTablePtr table,
  *
  * Create a new xmlHashTablePtr.
  *
- * Returns the newly created object, or NULL if an error occured.
+ * Returns the newly created object, or NULL if an error occurred.
  */
 xmlHashTablePtr
 xmlHashCreate(int size) {
@@ -202,7 +202,7 @@ xmlHashCreate(int size) {
  *
  * Create a new xmlHashTablePtr which will use @dict as the internal dictionary
  *
- * Returns the newly created object, or NULL if an error occured.
+ * Returns the newly created object, or NULL if an error occurred.
  */
 xmlHashTablePtr
 xmlHashCreateDict(int size, xmlDictPtr dict) {
@@ -984,6 +984,9 @@ xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f) {
        return(NULL);
 
     ret = xmlHashCreate(table->size);
+    if (ret == NULL)
+        return(NULL);
+
     if (table->table) {
        for(i = 0; i < table->size; i++) {
            if (table->table[i].valid == 0)