Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Unified Diff: third_party/libxslt/libxslt/functions.c

Issue 10823168: Fix harmless memory error in generate-id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libxml/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libxslt/libxslt/functions.c
===================================================================
--- third_party/libxslt/libxslt/functions.c (revision 148983)
+++ third_party/libxslt/libxslt/functions.c (working copy)
@@ -654,6 +654,7 @@
void
xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
xmlNodePtr cur = NULL;
+ xmlXPathObjectPtr obj = NULL;
long val;
xmlChar str[30];
xmlDocPtr doc;
@@ -661,7 +662,6 @@
if (nargs == 0) {
cur = ctxt->context->node;
} else if (nargs == 1) {
- xmlXPathObjectPtr obj;
xmlNodeSetPtr nodelist;
int i, ret;
@@ -684,7 +684,6 @@
if (ret == -1)
cur = nodelist->nodeTab[i];
}
- xmlXPathFreeObject(obj);
} else {
xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
"generate-id() : invalid number of args %d\n", nargs);
@@ -707,6 +706,9 @@
}
+ if (obj)
+ xmlXPathFreeObject(obj);
+
val = (long)((char *)cur - (char *)doc);
if (val >= 0) {
sprintf((char *)str, "idp%ld", val);
« no previous file with comments | « third_party/libxml/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698