Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

__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.
  • Loading branch information...
commit c2a0fdc4e6d106690d7fd8fa1677e133c94e155d 1 parent 241d4a1
authored February 23, 2011 veillard committed February 23, 2011

Showing 1 changed file with 8 additions and 13 deletions. Show diff stats Hide diff stats

  1. 21  error.c
21  error.c
@@ -584,6 +584,11 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
584 584
     if (to != &xmlLastError)
585 585
         xmlCopyError(to,&xmlLastError);
586 586
 
  587
+    if (schannel != NULL) {
  588
+	schannel(data, to);
  589
+	return;
  590
+    }
  591
+
587 592
     /*
588 593
      * Find the callback channel if channel param is NULL
589 594
      */
@@ -595,19 +600,9 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
595 600
 	    channel = ctxt->sax->error;
596 601
 	data = ctxt->userData;
597 602
     } else if (channel == NULL) {
598  
-        if ((schannel == NULL) && (xmlStructuredError != NULL)) {
599  
-	    schannel = xmlStructuredError;
600  
-	    data = xmlStructuredErrorContext;
601  
-	} else {
602  
-	    channel = xmlGenericError;
603  
-	    if (!data) {
604  
-		data = xmlGenericErrorContext;
605  
-	    }
606  
-	}
607  
-    }
608  
-    if (schannel != NULL) {
609  
-        schannel(data, to);
610  
-	return;
  603
+	channel = xmlGenericError;
  604
+	if (!data)
  605
+	    data = xmlGenericErrorContext;
611 606
     }
612 607
     if (channel == NULL)
613 608
         return;

0 notes on commit c2a0fdc

Please sign in to comment.
Something went wrong with that request. Please try again.