diff options
author | William M. Brack <wbrack@src.gnome.org> | 2004-07-31 16:24:01 +0000 |
---|---|---|
committer | William M. Brack <wbrack@src.gnome.org> | 2004-07-31 16:24:01 +0000 |
commit | a3215c7ae6b1441ceb046c61cc93a70a74bd7f9c (patch) | |
tree | 6fd0505dd08d2941b9dd909b305e8fe71a84d88e /uri.c | |
parent | ac996a1df22b6ebefd42ae1fb0a47ebe632c477a (diff) | |
download | libxml2-a3215c7ae6b1441ceb046c61cc93a70a74bd7f9c.tar.gz |
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.
Diffstat (limited to 'uri.c')
-rw-r--r-- | uri.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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); |