1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-08 21:42:07 +03:00

tried to fix #102800 for good. Reenabled memory debug checking which got

* 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
Daniel
This commit is contained in:
Daniel Veillard
2003-01-09 17:21:02 +00:00
parent dda2ed17ba
commit 12ac683775
5 changed files with 35 additions and 12 deletions

View File

@@ -1,3 +1,10 @@
Thu Jan 9 18:17:40 CET 2003 Daniel Veillard <daniel@veillard.com>
* 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 <daniel@veillard.com> Thu Jan 9 14:28:19 CET 2003 Daniel Veillard <daniel@veillard.com>
* tests/REC/test-8-1.xsl tests/REC/test-9.1-2.xsl * tests/REC/test-8-1.xsl tests/REC/test-9.1-2.xsl

View File

@@ -1656,8 +1656,10 @@ _exsltDateAddDuration (exsltDateValPtr x, exsltDateValPtr y)
if ((((ret->value.dur.day > 0) || (ret->value.dur.sec > 0)) && if ((((ret->value.dur.day > 0) || (ret->value.dur.sec > 0)) &&
(ret->value.dur.mon < 0)) || (ret->value.dur.mon < 0)) ||
(((ret->value.dur.day < 0) || (ret->value.dur.sec < 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 NULL;
}
return ret; return ret;
} }
@@ -2775,8 +2777,11 @@ exsltDateDifference (const xmlChar *xstr, const xmlChar *ystr)
} }
if (((x->type < XS_GYEAR) || (x->type > XS_DATETIME)) || 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; return NULL;
}
dur = _exsltDateDifference(x, y, 0); dur = _exsltDateDifference(x, y, 0);

View File

@@ -170,6 +170,7 @@ xsltAddAttrElemList(xsltAttrElemPtr list, xmlNodePtr attr) {
return(cur); return(cur);
if (cur->next == NULL) { if (cur->next == NULL) {
cur->next = xsltNewAttrElem(attr); cur->next = xsltNewAttrElem(attr);
return(list);
} }
cur = next; cur = next;
} }
@@ -372,14 +373,16 @@ xsltParseStylesheetAttributeSet(xsltStylesheetPtr style, xmlNodePtr cur) {
values2->set = ncname2; values2->set = ncname2;
values2->ns = prefix2; values2->ns = prefix2;
values = xsltMergeAttrElemList(values, values2); values = xsltMergeAttrElemList(values, values2);
xsltFreeAttrElem(values2);
} else {
if (ncname2 != NULL)
xmlFree(ncname2);
if (prefix2 != NULL)
xmlFree(prefix2);
} }
if (attrib != NULL) if (attrib != NULL)
xmlFree(attrib); xmlFree(attrib);
if (ncname2 != NULL)
xmlFree(ncname2);
if (prefix2 != NULL)
xmlFree(prefix2);
} }
attrib = endattr; attrib = endattr;
} }

View File

@@ -1081,7 +1081,7 @@ xsltSaveResultTo(xmlOutputBufferPtr buf, xmlDocPtr result,
} else { } else {
htmlSetMetaEncoding(result, (const xmlChar *) "UTF-8"); htmlSetMetaEncoding(result, (const xmlChar *) "UTF-8");
} }
if (indent != 0) if (indent == -1)
indent = 1; indent = 1;
htmlDocContentDumpFormatOutput(buf, result, (const char *) encoding, htmlDocContentDumpFormatOutput(buf, result, (const char *) encoding,
indent); indent);

View File

@@ -547,7 +547,13 @@ main(int argc, char **argv)
(!strcmp(argv[i], "-output")) || (!strcmp(argv[i], "-output")) ||
(!strcmp(argv[i], "--output"))) { (!strcmp(argv[i], "--output"))) {
i++; i++;
#if defined(WIN32)
output = xmlNormalizeWindowsPath(argv[i]);
if (output == NULL)
output = xmlStrdup(argv[i]);
#else
output = argv[i]; output = argv[i];
#endif
} else if ((!strcmp(argv[i], "-V")) || } else if ((!strcmp(argv[i], "-V")) ||
(!strcmp(argv[i], "-version")) || (!strcmp(argv[i], "-version")) ||
(!strcmp(argv[i], "--version"))) { (!strcmp(argv[i], "--version"))) {
@@ -815,17 +821,19 @@ main(int argc, char **argv)
xsltProcess(doc, cur, argv[i]); xsltProcess(doc, cur, argv[i]);
} }
} }
done:
if (cur != NULL) if (cur != NULL)
xsltFreeStylesheet(cur); xsltFreeStylesheet(cur);
for (i = 0;i < nbstrparams;i++) for (i = 0;i < nbstrparams;i++)
xmlFree(strparams[i]); xmlFree(strparams[i]);
done: #if defined(WIN32)
xsltCleanupGlobals(); if (output != NULL)
xmlCleanupParser(); xmlFree(output);
#if 0
xmlMemoryDump();
#endif #endif
xsltFreeSecurityPrefs(sec); xsltFreeSecurityPrefs(sec);
xsltCleanupGlobals();
xmlCleanupParser();
xmlMemoryDump();
return(errorno); return(errorno);
} }