Commits

Anonymous committed ef88968

Modified Files:
LibXML.xs dom.c
+ appendTextNode segfault fix

Comments (0)

Files changed (2)

         if (self == NULL) {
            XSRETURN_UNDEF;
         }
+             
         # warn("xmlFreeDoc(%d)\n", self);
         xmlFreeDoc(self);
 
+
 SV *
 toString(self)
         xmlDocPtr self
         if (node->extra != NULL) {
             SvREFCNT_dec(node->extra);
         }
-        Safefree(node);
-        /* warn( "Free node\n" ); */
-        /*domUnbindNode( node );  * before freeing we unbind the node from
-		                          * possible siblings */
-        /* xmlFreeNode( node ); */
+
+        # warn( "Free node\n" );
+        Safefree(node); 
+    
     
 	
 int 
         xmlNodePtr tn;
     CODE:
         if ( self->doc != NULL && xmlString != NULL ) {
-            tn == xmlNewDocText( self->doc, xmlString ); 
+            tn = xmlNewDocText( self->doc, xmlString ); 
             domAppendChild( self, tn );
         }
 
     newChild->doc = self->doc;
   }
   
-  if ( self->children != 0 ) {
+  if ( self->children != NULL ) {
     if ( newChild->type   == XML_TEXT_NODE && 
 	 self->last->type == XML_TEXT_NODE ) {
       int len = xmlStrlen(newChild->content);
       self->parent->last = self->prev;
     if ( self == self->parent->children ) 
       self->parent->children = self->next;
-    
+
     self->parent = 0;
     self->next   = 0;
     self->prev   = 0;
   }
-
   return self;
 }