perl-XML-LibXML / perl-libxml-sax.c

Diff from to

perl-libxml-sax.c

     decl = xmlStrndup( name, len );
     
     if ( xmlStrcmp( "xmlns", decl ) != 0 ) {
-        pos= NULL;
+        pos = NULL;
     }
 
     xmlFree( decl );
             ns = PmmGetNsMapping( sax->ns_stack, prefix );
 
             hv_store(retval, "Prefix", 6,
-                     C2Sv(prefix, NULL), PrefixHash);
+                     sv_2mortal(C2Sv(prefix, NULL)), PrefixHash);
 
             if ( ns != NULL ) {
                 hv_store(retval, "NamespaceURI", 12,
-                         C2Sv(ns->href, NULL), NsURIHash);
+                         sv_2mortal(C2Sv(ns->href, NULL)), NsURIHash);
             } 
             else {
                 hv_store(retval, "NamespaceURI", 12,
             }
 
             hv_store(retval, "LocalName", 9,
-                     C2Sv(localname, NULL), LocalNameHash);
+                     sv_2mortal(C2Sv(localname, NULL)), LocalNameHash);
             
             xmlFree(localname);
             xmlFree(prefix);
             hv_store(retval, "NamespaceURI", 12,
                      SvREFCNT_inc(empty_sv), NsURIHash);
             hv_store(retval, "LocalName", 9,
-                     C2Sv(name, NULL), LocalNameHash);
+                     sv_2mortal(C2Sv(name, NULL)), LocalNameHash);
         }
                 
     }
     const xmlChar **ta = attr;
     const xmlChar * name = NULL;
     const xmlChar * value = NULL;
-    xmlChar * keyname;
+    xmlChar * keyname = NULL;
 
     if ( attr != NULL ) {
         while ( *ta != NULL ) {
                 const xmlChar * pos = PmmDetectNamespace( name );
 
                 hv_store(atV, "Name", 4,
-                         C2Sv(name, NULL), NameHash);
+                         sv_2mortal(C2Sv(name, NULL)), NameHash);
                 hv_store(atV, "Value", 5,
-                         C2Sv(value, NULL), ValueHash);
+                         sv_2mortal(C2Sv(value, NULL)), ValueHash);
                 
                 if ( pos != NULL ) {
                     xmlNsPtr ns = NULL;
                     ns = PmmGetNsMapping( sax->ns_stack, prefix );
             
                     hv_store(atV, "Prefix", 6,
-                             C2Sv(prefix, NULL), PrefixHash);
+                             sv_2mortal(C2Sv(prefix, NULL)), PrefixHash);
 
                     if ( ns != NULL ) {
                         nsURI = xmlStrdup( ns->href );
                         hv_store(atV, "NamespaceURI", 12,
-                                 C2Sv(ns->href, NULL), NsURIHash);
+                                 sv_2mortal(C2Sv(ns->href, NULL)), NsURIHash);
                     }
                     else {
                         hv_store(atV, "NamespaceURI", 12,
                     }
                     
                     hv_store(atV, "LocalName", 9,
-                             C2Sv(localname, NULL), LocalNameHash);
+                             sv_2mortal(C2Sv(localname, NULL)), LocalNameHash);
                     
                     xmlFree(prefix);
                 }
                     hv_store(atV, "NamespaceURI", 12,
                              SvREFCNT_inc(empty_sv), NsURIHash);
                     hv_store(atV, "LocalName", 9,
-                             C2Sv(name, NULL), LocalNameHash);            
+                             sv_2mortal(C2Sv(name, NULL)), LocalNameHash);            
                 }
             }
             
 
     if ( data != NULL && xmlStrlen( data ) ) {
         hv_store(retval, "Data", 4,
-                 C2Sv(data, NULL), DataHash);
+                 sv_2mortal(C2Sv(data, NULL)), DataHash);
     }
 
     return retval;
 
     if ( target != NULL && xmlStrlen( target ) ) {
         hv_store(retval, "Target", 6,
-                 C2Sv(data, NULL), TargetHash);
+                 sv_2mortal(C2Sv(data, NULL)), TargetHash);
 
         if ( data != NULL && xmlStrlen( data ) ) {
             hv_store(retval, "Data", 4,
-                     C2Sv(data, NULL), DataHash);
+                     sv_2mortal(C2Sv(data, NULL)), DataHash);
         }
         else {
             hv_store(retval, "Data", 4,
-                     C2Sv("", NULL), DataHash);
+                     sv_2mortal(C2Sv("", NULL)), DataHash);
         }
     }
 
     PUSHMARK(SP) ;
     XPUSHs(sax->parser);
 
-    XPUSHs(svMessage);
+    XPUSHs(sv_2mortal(svMessage));
     XPUSHs(sv_2mortal(newSViv(ctxt->input->line)));
     XPUSHs(sv_2mortal(newSViv(ctxt->input->col)));
 
     PUSHMARK(SP) ;
     XPUSHs(sax->parser);
 
-    XPUSHs(svMessage);
+    XPUSHs(sv_2mortal(svMessage));
     XPUSHs(sv_2mortal(newSViv(ctxt->input->line)));
     XPUSHs(sv_2mortal(newSViv(ctxt->input->col)));
     PUTBACK;
     PUSHMARK(SP) ;
     XPUSHs(sax->parser);
 
-    XPUSHs(svMessage);
+    XPUSHs(sv_2mortal(svMessage));
     XPUSHs(sv_2mortal(newSViv(ctxt->input->line)));
     XPUSHs(sv_2mortal(newSViv(ctxt->input->col)));
     PUTBACK;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.