valgrind'ed and cleaned up a couple of memory issues. Daniel
* relaxng.c: valgrind'ed and cleaned up a couple of memory issues.
Daniel
diff --git a/ChangeLog b/ChangeLog
index 4f0ae9a..f14435c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sat Mar 22 18:50:45 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+ * relaxng.c: valgrind'ed and cleaned up a couple of memory issues.
+
Sat Mar 22 16:15:50 CET 2003 Daniel Veillard <daniel@veillard.com>
* SAX.c: fix bug #107208 avoid false duplicates when ID/REFs are
diff --git a/relaxng.c b/relaxng.c
index b1245d7..b8c0b5c 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -1545,16 +1545,18 @@
xmlGenericError(xmlGenericErrorContext, "malloc failed !\n");
return (0);
}
+ ctxt->err = NULL;
}
if (ctxt->errNr >= ctxt->errMax) {
- ctxt->errMax *= 2;
+ ctxt->errMax *= 2;
ctxt->errTab =
(xmlRelaxNGValidErrorPtr) xmlRealloc(ctxt->errTab,
- ctxt->errMax * sizeof(xmlRelaxNGValidError));
+ ctxt->errMax * sizeof(xmlRelaxNGValidError));
if (ctxt->errTab == NULL) {
xmlGenericError(xmlGenericErrorContext, "realloc failed !\n");
return (0);
}
+ ctxt->err = &ctxt->errTab[ctxt->errNr - 1];
}
if ((ctxt->err != NULL) && (ctxt->state != NULL) &&
(ctxt->err->node == ctxt->state->node) &&
@@ -3588,6 +3590,7 @@
xmlMalloc(sizeof(xmlRelaxNGPartition));
if (partitions == NULL)
goto error;
+ memset(partitions, 0, sizeof(xmlRelaxNGPartition));
partitions->nbgroups = nbgroups;
partitions->triage = xmlHashCreate(nbgroups);
for (i = 0;i < nbgroups;i++) {