1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-20 03:52:25 +03:00

many further little changes for OOM problems. Now seems to be getting

* SAX2.c, encoding.c, error.c, parser.c, tree.c, uri.c, xmlIO.c,
  xmlreader.c, include/libxml/tree.h: many further little changes
  for OOM problems.  Now seems to be getting closer to "ok".
* testOOM.c: added code to intercept more errors, found more
  problems with library. Changed method of flagging / counting
  errors intercepted.
This commit is contained in:
William M. Brack
2004-07-31 16:24:01 +00:00
parent ac996a1df2
commit a3215c7ae6
11 changed files with 184 additions and 83 deletions

11
uri.c
View File

@@ -1409,8 +1409,8 @@ xmlParseURIPathSegments(xmlURIPtr uri, const char **str, int slash)
}
path = (char *) xmlMallocAtomic(len + 1);
if (path == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlParseURIPathSegments: out of memory\n");
xmlGenericError(xmlGenericErrorContext,
"xmlParseURIPathSegments: out of memory\n");
*str = cur;
return (-1);
}
@@ -2202,7 +2202,7 @@ xmlCanonicPath(const xmlChar *path)
p = uri->path + 1;
strncpy(p, path, len + 1);
} else {
uri->path = xmlStrdup(path);
uri->path = xmlStrdup(path); /* FIXME - check alloc! */
p = uri->path;
}
while (*p != '\0') {
@@ -2213,7 +2213,10 @@ xmlCanonicPath(const xmlChar *path)
#else
uri->path = (char *) xmlStrdup((const xmlChar *) path);
#endif
if (uri->path == NULL) {
xmlFreeURI(uri);
return(NULL);
}
ret = xmlSaveUri(uri);
xmlFreeURI(uri);
return(ret);