@@ -435,7 +435,8 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
435
435
436
436
itemType = get_attribute (listType -> properties , "itemType" );
437
437
if (itemType != NULL ) {
438
- char * type , * ns ;
438
+ const char * type ;
439
+ char * ns ;
439
440
xmlNsPtr nsptr ;
440
441
441
442
parse_namespace (itemType -> children -> content , & type , & ns );
@@ -457,7 +458,6 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
457
458
}
458
459
zend_hash_next_index_insert_ptr (cur_type -> elements , newType );
459
460
}
460
- if (type ) {efree (type );}
461
461
if (ns ) {efree (ns );}
462
462
}
463
463
@@ -519,7 +519,8 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
519
519
memberTypes = get_attribute (unionType -> properties , "memberTypes" );
520
520
if (memberTypes != NULL ) {
521
521
char * str , * start , * end , * next ;
522
- char * type , * ns ;
522
+ const char * type ;
523
+ char * ns ;
523
524
xmlNsPtr nsptr ;
524
525
525
526
str = estrdup ((char * )memberTypes -> children -> content );
@@ -553,7 +554,6 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
553
554
}
554
555
zend_hash_next_index_insert_ptr (cur_type -> elements , newType );
555
556
}
556
- if (type ) {efree (type );}
557
557
if (ns ) {efree (ns );}
558
558
559
559
start = next ;
@@ -662,15 +662,15 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP
662
662
663
663
base = get_attribute (restType -> properties , "base" );
664
664
if (base != NULL ) {
665
- char * type , * ns ;
665
+ const char * type ;
666
+ char * ns ;
666
667
xmlNsPtr nsptr ;
667
668
668
669
parse_namespace (base -> children -> content , & type , & ns );
669
670
nsptr = xmlSearchNs (restType -> doc , restType , BAD_CAST (ns ));
670
671
if (nsptr != NULL ) {
671
672
cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
672
673
}
673
- if (type ) {efree (type );}
674
674
if (ns ) {efree (ns );}
675
675
} else if (!simpleType ) {
676
676
soap_error0 (E_ERROR , "Parsing Schema: restriction has no 'base' attribute" );
@@ -767,15 +767,15 @@ static int schema_restriction_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNode
767
767
768
768
base = get_attribute (restType -> properties , "base" );
769
769
if (base != NULL ) {
770
- char * type , * ns ;
770
+ const char * type ;
771
+ char * ns ;
771
772
xmlNsPtr nsptr ;
772
773
773
774
parse_namespace (base -> children -> content , & type , & ns );
774
775
nsptr = xmlSearchNs (restType -> doc , restType , BAD_CAST (ns ));
775
776
if (nsptr != NULL ) {
776
777
cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
777
778
}
778
- if (type ) {efree (type );}
779
779
if (ns ) {efree (ns );}
780
780
} else {
781
781
soap_error0 (E_ERROR , "Parsing Schema: restriction has no 'base' attribute" );
@@ -892,15 +892,15 @@ static int schema_extension_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr
892
892
893
893
base = get_attribute (extType -> properties , "base" );
894
894
if (base != NULL ) {
895
- char * type , * ns ;
895
+ const char * type ;
896
+ char * ns ;
896
897
xmlNsPtr nsptr ;
897
898
898
899
parse_namespace (base -> children -> content , & type , & ns );
899
900
nsptr = xmlSearchNs (extType -> doc , extType , BAD_CAST (ns ));
900
901
if (nsptr != NULL ) {
901
902
cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
902
903
}
903
- if (type ) {efree (type );}
904
904
if (ns ) {efree (ns );}
905
905
} else {
906
906
soap_error0 (E_ERROR , "Parsing Schema: extension has no 'base' attribute" );
@@ -947,15 +947,15 @@ static int schema_extension_complexContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodePt
947
947
948
948
base = get_attribute (extType -> properties , "base" );
949
949
if (base != NULL ) {
950
- char * type , * ns ;
950
+ const char * type ;
951
+ char * ns ;
951
952
xmlNsPtr nsptr ;
952
953
953
954
parse_namespace (base -> children -> content , & type , & ns );
954
955
nsptr = xmlSearchNs (extType -> doc , extType , BAD_CAST (ns ));
955
956
if (nsptr != NULL ) {
956
957
cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
957
958
}
958
- if (type ) {efree (type );}
959
959
if (ns ) {efree (ns );}
960
960
} else {
961
961
soap_error0 (E_ERROR , "Parsing Schema: extension has no 'base' attribute" );
@@ -1096,7 +1096,8 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
1096
1096
smart_str key = {0 };
1097
1097
1098
1098
if (ref ) {
1099
- char * type , * ns ;
1099
+ const char * type ;
1100
+ char * ns ;
1100
1101
xmlNsPtr nsptr ;
1101
1102
1102
1103
parse_namespace (ref -> children -> content , & type , & ns );
@@ -1120,7 +1121,6 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
1120
1121
newModel -> kind = XSD_CONTENT_GROUP_REF ;
1121
1122
newModel -> u .group_ref = estrndup (ZSTR_VAL (key .s ), ZSTR_LEN (key .s ));
1122
1123
1123
- if (type ) {efree (type );}
1124
1124
if (ns ) {efree (ns );}
1125
1125
} else {
1126
1126
newModel = emalloc (sizeof (sdlContentModel ));
@@ -1534,7 +1534,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
1534
1534
1535
1535
if (ref ) {
1536
1536
smart_str nscat = {0 };
1537
- char * type , * ns ;
1537
+ const char * type ;
1538
+ char * ns ;
1538
1539
xmlNsPtr nsptr ;
1539
1540
1540
1541
parse_namespace (ref -> children -> content , & type , & ns );
@@ -1555,7 +1556,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
1555
1556
smart_str_appends (& nscat , type );
1556
1557
newType -> name = estrdup (type );
1557
1558
smart_str_0 (& nscat );
1558
- if (type ) {efree (type );}
1559
1559
if (ns ) {efree (ns );}
1560
1560
newType -> ref = estrndup (ZSTR_VAL (nscat .s ), ZSTR_LEN (nscat .s ));
1561
1561
smart_str_free (& nscat );
@@ -1679,7 +1679,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
1679
1679
/* type = QName */
1680
1680
type = get_attribute (attrs , "type" );
1681
1681
if (type ) {
1682
- char * cptype , * str_ns ;
1682
+ const char * cptype ;
1683
+ char * str_ns ;
1683
1684
xmlNsPtr nsptr ;
1684
1685
1685
1686
if (ref != NULL ) {
@@ -1691,7 +1692,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
1691
1692
cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (cptype ));
1692
1693
}
1693
1694
if (str_ns ) {efree (str_ns );}
1694
- if (cptype ) {efree (cptype );}
1695
1695
}
1696
1696
1697
1697
trav = element -> children ;
@@ -1766,7 +1766,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
1766
1766
memset (newAttr , 0 , sizeof (sdlAttribute ));
1767
1767
1768
1768
if (ref ) {
1769
- char * attr_name , * ns ;
1769
+ const char * attr_name ;
1770
+ char * ns ;
1770
1771
xmlNsPtr nsptr ;
1771
1772
1772
1773
parse_namespace (ref -> children -> content , & attr_name , & ns );
@@ -1787,7 +1788,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
1787
1788
smart_str_appends (& key , attr_name );
1788
1789
smart_str_0 (& key );
1789
1790
newAttr -> ref = estrndup (ZSTR_VAL (key .s ), ZSTR_LEN (key .s ));
1790
- if (attr_name ) {efree (attr_name );}
1791
1791
if (ns ) {efree (ns );}
1792
1792
} else {
1793
1793
xmlAttrPtr ns ;
@@ -1827,7 +1827,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
1827
1827
/* type = QName */
1828
1828
type = get_attribute (attrType -> properties , "type" );
1829
1829
if (type ) {
1830
- char * cptype , * str_ns ;
1830
+ const char * cptype ;
1831
+ char * str_ns ;
1831
1832
xmlNsPtr nsptr ;
1832
1833
1833
1834
if (ref != NULL ) {
@@ -1839,7 +1840,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
1839
1840
newAttr -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (cptype ));
1840
1841
}
1841
1842
if (str_ns ) {efree (str_ns );}
1842
- if (cptype ) {efree (cptype );}
1843
1843
}
1844
1844
1845
1845
attr = attrType -> properties ;
@@ -1881,7 +1881,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
1881
1881
smart_str key2 = {0 };
1882
1882
sdlExtraAttributePtr ext ;
1883
1883
xmlNsPtr nsptr ;
1884
- char * value , * ns ;
1884
+ const char * value ;
1885
+ char * ns ;
1885
1886
1886
1887
ext = emalloc (sizeof (sdlExtraAttribute ));
1887
1888
memset (ext , 0 , sizeof (sdlExtraAttribute ));
@@ -1894,7 +1895,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
1894
1895
ext -> val = estrdup ((char * )attr -> children -> content );
1895
1896
}
1896
1897
if (ns ) {efree (ns );}
1897
- efree (value );
1898
1898
1899
1899
if (!newAttr -> extraAttributes ) {
1900
1900
newAttr -> extraAttributes = emalloc (sizeof (HashTable ));
@@ -2007,7 +2007,8 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou
2007
2007
smart_str_free (& key );
2008
2008
} else if (ref ) {
2009
2009
sdlAttributePtr newAttr ;
2010
- char * group_name , * ns ;
2010
+ const char * group_name ;
2011
+ char * ns ;
2011
2012
smart_str key = {0 };
2012
2013
xmlNsPtr nsptr ;
2013
2014
@@ -2027,7 +2028,6 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou
2027
2028
smart_str_appends (& key , group_name );
2028
2029
smart_str_0 (& key );
2029
2030
newAttr -> ref = estrndup (ZSTR_VAL (key .s ), ZSTR_LEN (key .s ));
2030
- if (group_name ) {efree (group_name );}
2031
2031
if (ns ) {efree (ns );}
2032
2032
smart_str_free (& key );
2033
2033
0 commit comments