diff --git a/ChangeLog b/ChangeLog index e3bceccb..931e041b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Jan 9 18:17:40 CET 2003 Daniel Veillard + + * xsltproc/xsltproc.c: tried to fix #102800 for good. Reenabled + memory debug checking which got deactivated at some point ?!? + * libexslt/date.c libxslt/attributes.c: fixing some memory leaks + * libxslt/xsltutils.c: very small change on HTML indentation handling + Thu Jan 9 14:28:19 CET 2003 Daniel Veillard * tests/REC/test-8-1.xsl tests/REC/test-9.1-2.xsl diff --git a/libexslt/date.c b/libexslt/date.c index 114a7bf3..51f1c536 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -1656,8 +1656,10 @@ _exsltDateAddDuration (exsltDateValPtr x, exsltDateValPtr y) if ((((ret->value.dur.day > 0) || (ret->value.dur.sec > 0)) && (ret->value.dur.mon < 0)) || (((ret->value.dur.day < 0) || (ret->value.dur.sec < 0)) && - (ret->value.dur.mon > 0))) + (ret->value.dur.mon > 0))) { + exsltDateFreeDate(ret); return NULL; + } return ret; } @@ -2775,8 +2777,11 @@ exsltDateDifference (const xmlChar *xstr, const xmlChar *ystr) } if (((x->type < XS_GYEAR) || (x->type > XS_DATETIME)) || - ((y->type < XS_GYEAR) || (y->type > XS_DATETIME))) + ((y->type < XS_GYEAR) || (y->type > XS_DATETIME))) { + exsltDateFreeDate(x); + exsltDateFreeDate(y); return NULL; + } dur = _exsltDateDifference(x, y, 0); diff --git a/libxslt/attributes.c b/libxslt/attributes.c index 62122513..ecd9f64f 100644 --- a/libxslt/attributes.c +++ b/libxslt/attributes.c @@ -170,6 +170,7 @@ xsltAddAttrElemList(xsltAttrElemPtr list, xmlNodePtr attr) { return(cur); if (cur->next == NULL) { cur->next = xsltNewAttrElem(attr); + return(list); } cur = next; } @@ -372,14 +373,16 @@ xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) { values2->set = ncname2; values2->ns = prefix2; values = xsltMergeAttrElemList(values, values2); + xsltFreeAttrElem(values2); + } else { + if (ncname2 != NULL) + xmlFree(ncname2); + if (prefix2 != NULL) + xmlFree(prefix2); } if (attrib != NULL) xmlFree(attrib); - if (ncname2 != NULL) - xmlFree(ncname2); - if (prefix2 != NULL) - xmlFree(prefix2); } attrib = endattr; } diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c index 5abfe492..d7a4b9b6 100644 --- a/libxslt/xsltutils.c +++ b/libxslt/xsltutils.c @@ -1081,7 +1081,7 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result, } else { htmlSetMetaEncoding(result, (const xmlChar *) "UTF-8"); } - if (indent != 0) + if (indent == -1) indent = 1; htmlDocContentDumpFormatOutput(buf, result, (const char *) encoding, indent); diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index fe1e2589..35c6c3f2 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -547,7 +547,13 @@ main(int argc, char **argv) (!strcmp(argv[i], "-output")) || (!strcmp(argv[i], "--output"))) { i++; +#if defined(WIN32) + output = xmlNormalizeWindowsPath(argv[i]); + if (output == NULL) + output = xmlStrdup(argv[i]); +#else output = argv[i]; +#endif } else if ((!strcmp(argv[i], "-V")) || (!strcmp(argv[i], "-version")) || (!strcmp(argv[i], "--version"))) { @@ -815,17 +821,19 @@ main(int argc, char **argv) xsltProcess(doc, cur, argv[i]); } } +done: if (cur != NULL) xsltFreeStylesheet(cur); for (i = 0;i < nbstrparams;i++) xmlFree(strparams[i]); -done: - xsltCleanupGlobals(); - xmlCleanupParser(); -#if 0 - xmlMemoryDump(); +#if defined(WIN32) + if (output != NULL) + xmlFree(output); #endif xsltFreeSecurityPrefs(sec); + xsltCleanupGlobals(); + xmlCleanupParser(); + xmlMemoryDump(); return(errorno); }