summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2011-02-23 14:44:05 +0000
committerDmitry V. Levin <ldv@altlinux.org>2011-02-23 14:44:05 +0000
commitbb164b36dee7a10ad6e79d26fd55f8aa214ad41b (patch)
treece79723d8dddb6e73607f54da53f4e9919693c86
parent4af33a006b65e73c1b3436beb6a080da1e07dd0b (diff)
downloadlibxml2-bb164b36dee7a10ad6e79d26fd55f8aa214ad41b.tar.gz
__xmlRaiseError: fix use of the structured callback channel
If the structured callback channel is initialized, do not perform unneeded initialization of the old callback channel to avoid clobbering of the structured callback channel's data.
-rw-r--r--error.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/error.c b/error.c
index 9c0f6bb..a891faa 100644
--- a/error.c
+++ b/error.c
@@ -584,6 +584,11 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
if (to != &xmlLastError)
xmlCopyError(to,&xmlLastError);
+ if (schannel != NULL) {
+ schannel(data, to);
+ return;
+ }
+
/*
* Find the callback channel if channel param is NULL
*/
@@ -595,19 +600,9 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
channel = ctxt->sax->error;
data = ctxt->userData;
} else if (channel == NULL) {
- if ((schannel == NULL) && (xmlStructuredError != NULL)) {
- schannel = xmlStructuredError;
- data = xmlStructuredErrorContext;
- } else {
- channel = xmlGenericError;
- if (!data) {
- data = xmlGenericErrorContext;
- }
- }
- }
- if (schannel != NULL) {
- schannel(data, to);
- return;
+ channel = xmlGenericError;
+ if (!data)
+ data = xmlGenericErrorContext;
}
if (channel == NULL)
return;