further fixes for out of memory condition, mostly from Olivier Andrieu.
* SAX2.c, tree.c, uri.c, xmlIO.c, xmlreader.c: further
fixes for out of memory condition, mostly from Olivier
Andrieu.
* testOOM.c: some further improvement by Olivier, with
a further small enhancement for easier debugging.
diff --git a/uri.c b/uri.c
index 31e51a3..d9dc760 100644
--- a/uri.c
+++ b/uri.c
@@ -2124,6 +2124,8 @@
ix = xmlStrlen (uptr) + 1;
val = (xmlChar *) xmlMalloc (ix + 3 * nbslash);
if (val == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlBuildRelativeURI: out of memory\n");
goto done;
}
vptr = val;
@@ -2195,7 +2197,7 @@
len = xmlStrlen(path);
if ((len > 2) && IS_WINDOWS_PATH(path)) {
uri->scheme = xmlStrdup(BAD_CAST "file");
- uri->path = xmlMallocAtomic(len + 2);
+ uri->path = xmlMallocAtomic(len + 2); /* FIXME - check alloc! */
uri->path[0] = '/';
p = uri->path + 1;
strncpy(p, path, len + 1);