summaryrefslogtreecommitdiff
path: root/chromium/third_party/libxml/src/SAX2.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/libxml/src/SAX2.c')
-rw-r--r--chromium/third_party/libxml/src/SAX2.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/chromium/third_party/libxml/src/SAX2.c b/chromium/third_party/libxml/src/SAX2.c
index 99019a984cd..031924652a4 100644
--- a/chromium/third_party/libxml/src/SAX2.c
+++ b/chromium/third_party/libxml/src/SAX2.c
@@ -742,6 +742,7 @@ xmlSAX2AttributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname,
xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
"SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n",
name, NULL);
+ xmlFree(name);
xmlFreeEnumeration(tree);
return;
}
@@ -1622,10 +1623,10 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
ctxt->nodemem = -1;
if (ctxt->linenumbers) {
if (ctxt->input != NULL) {
- if (ctxt->input->line < 65535)
- ret->line = (short) ctxt->input->line;
+ if (ctxt->input->line < USHRT_MAX)
+ ret->line = (unsigned short) ctxt->input->line;
else
- ret->line = 65535;
+ ret->line = USHRT_MAX;
}
}
@@ -1886,10 +1887,10 @@ skip:
if (ctxt->linenumbers) {
if (ctxt->input != NULL) {
- if (ctxt->input->line < 65535)
- ret->line = (short) ctxt->input->line;
+ if (ctxt->input->line < USHRT_MAX)
+ ret->line = (unsigned short) ctxt->input->line;
else {
- ret->line = 65535;
+ ret->line = USHRT_MAX;
if (ctxt->options & XML_PARSE_BIG_LINES)
ret->psvi = (void *) (ptrdiff_t) ctxt->input->line;
}
@@ -2266,10 +2267,10 @@ xmlSAX2StartElementNs(void *ctx,
}
if (ctxt->linenumbers) {
if (ctxt->input != NULL) {
- if (ctxt->input->line < 65535)
- ret->line = (short) ctxt->input->line;
+ if (ctxt->input->line < USHRT_MAX)
+ ret->line = (unsigned short) ctxt->input->line;
else
- ret->line = 65535;
+ ret->line = USHRT_MAX;
}
}
@@ -2688,10 +2689,10 @@ xmlSAX2ProcessingInstruction(void *ctx, const xmlChar *target,
if (ctxt->linenumbers) {
if (ctxt->input != NULL) {
- if (ctxt->input->line < 65535)
- ret->line = (short) ctxt->input->line;
+ if (ctxt->input->line < USHRT_MAX)
+ ret->line = (unsigned short) ctxt->input->line;
else
- ret->line = 65535;
+ ret->line = USHRT_MAX;
}
}
if (ctxt->inSubset == 1) {
@@ -2748,10 +2749,10 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
if (ret == NULL) return;
if (ctxt->linenumbers) {
if (ctxt->input != NULL) {
- if (ctxt->input->line < 65535)
- ret->line = (short) ctxt->input->line;
+ if (ctxt->input->line < USHRT_MAX)
+ ret->line = (unsigned short) ctxt->input->line;
else
- ret->line = 65535;
+ ret->line = USHRT_MAX;
}
}