mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-02-04 01:47:02 +03:00
__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.
This commit is contained in:
parent
241d4a1069
commit
c2a0fdc4e6
21
error.c
21
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user