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:
11
uri.c
11
uri.c
@@ -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);
|
||||
|
Reference in New Issue
Block a user