@@ -435,7 +435,8 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
435435
436436 itemType = get_attribute (listType -> properties , "itemType" );
437437 if (itemType != NULL ) {
438- char * type , * ns ;
438+ const char * type ;
439+ char * ns ;
439440 xmlNsPtr nsptr ;
440441
441442 parse_namespace (itemType -> children -> content , & type , & ns );
@@ -457,7 +458,6 @@ static int schema_list(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr listType, sdlTypeP
457458 }
458459 zend_hash_next_index_insert_ptr (cur_type -> elements , newType );
459460 }
460- if (type ) {efree (type );}
461461 if (ns ) {efree (ns );}
462462 }
463463
@@ -519,7 +519,8 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
519519 memberTypes = get_attribute (unionType -> properties , "memberTypes" );
520520 if (memberTypes != NULL ) {
521521 char * str , * start , * end , * next ;
522- char * type , * ns ;
522+ const char * type ;
523+ char * ns ;
523524 xmlNsPtr nsptr ;
524525
525526 str = estrdup ((char * )memberTypes -> children -> content );
@@ -553,7 +554,6 @@ static int schema_union(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr unionType, sdlTyp
553554 }
554555 zend_hash_next_index_insert_ptr (cur_type -> elements , newType );
555556 }
556- if (type ) {efree (type );}
557557 if (ns ) {efree (ns );}
558558
559559 start = next ;
@@ -662,15 +662,15 @@ static int schema_restriction_simpleContent(sdlPtr sdl, xmlAttrPtr tns, xmlNodeP
662662
663663 base = get_attribute (restType -> properties , "base" );
664664 if (base != NULL ) {
665- char * type , * ns ;
665+ const char * type ;
666+ char * ns ;
666667 xmlNsPtr nsptr ;
667668
668669 parse_namespace (base -> children -> content , & type , & ns );
669670 nsptr = xmlSearchNs (restType -> doc , restType , BAD_CAST (ns ));
670671 if (nsptr != NULL ) {
671672 cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
672673 }
673- if (type ) {efree (type );}
674674 if (ns ) {efree (ns );}
675675 } else if (!simpleType ) {
676676 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
767767
768768 base = get_attribute (restType -> properties , "base" );
769769 if (base != NULL ) {
770- char * type , * ns ;
770+ const char * type ;
771+ char * ns ;
771772 xmlNsPtr nsptr ;
772773
773774 parse_namespace (base -> children -> content , & type , & ns );
774775 nsptr = xmlSearchNs (restType -> doc , restType , BAD_CAST (ns ));
775776 if (nsptr != NULL ) {
776777 cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
777778 }
778- if (type ) {efree (type );}
779779 if (ns ) {efree (ns );}
780780 } else {
781781 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
892892
893893 base = get_attribute (extType -> properties , "base" );
894894 if (base != NULL ) {
895- char * type , * ns ;
895+ const char * type ;
896+ char * ns ;
896897 xmlNsPtr nsptr ;
897898
898899 parse_namespace (base -> children -> content , & type , & ns );
899900 nsptr = xmlSearchNs (extType -> doc , extType , BAD_CAST (ns ));
900901 if (nsptr != NULL ) {
901902 cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
902903 }
903- if (type ) {efree (type );}
904904 if (ns ) {efree (ns );}
905905 } else {
906906 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
947947
948948 base = get_attribute (extType -> properties , "base" );
949949 if (base != NULL ) {
950- char * type , * ns ;
950+ const char * type ;
951+ char * ns ;
951952 xmlNsPtr nsptr ;
952953
953954 parse_namespace (base -> children -> content , & type , & ns );
954955 nsptr = xmlSearchNs (extType -> doc , extType , BAD_CAST (ns ));
955956 if (nsptr != NULL ) {
956957 cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (type ));
957958 }
958- if (type ) {efree (type );}
959959 if (ns ) {efree (ns );}
960960 } else {
961961 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
10961096 smart_str key = {0 };
10971097
10981098 if (ref ) {
1099- char * type , * ns ;
1099+ const char * type ;
1100+ char * ns ;
11001101 xmlNsPtr nsptr ;
11011102
11021103 parse_namespace (ref -> children -> content , & type , & ns );
@@ -1120,7 +1121,6 @@ static int schema_group(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr groupType, sdlTyp
11201121 newModel -> kind = XSD_CONTENT_GROUP_REF ;
11211122 newModel -> u .group_ref = estrndup (ZSTR_VAL (key .s ), ZSTR_LEN (key .s ));
11221123
1123- if (type ) {efree (type );}
11241124 if (ns ) {efree (ns );}
11251125 } else {
11261126 newModel = emalloc (sizeof (sdlContentModel ));
@@ -1534,7 +1534,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
15341534
15351535 if (ref ) {
15361536 smart_str nscat = {0 };
1537- char * type , * ns ;
1537+ const char * type ;
1538+ char * ns ;
15381539 xmlNsPtr nsptr ;
15391540
15401541 parse_namespace (ref -> children -> content , & type , & ns );
@@ -1555,7 +1556,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
15551556 smart_str_appends (& nscat , type );
15561557 newType -> name = estrdup (type );
15571558 smart_str_0 (& nscat );
1558- if (type ) {efree (type );}
15591559 if (ns ) {efree (ns );}
15601560 newType -> ref = estrndup (ZSTR_VAL (nscat .s ), ZSTR_LEN (nscat .s ));
15611561 smart_str_free (& nscat );
@@ -1679,7 +1679,8 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
16791679 /* type = QName */
16801680 type = get_attribute (attrs , "type" );
16811681 if (type ) {
1682- char * cptype , * str_ns ;
1682+ const char * cptype ;
1683+ char * str_ns ;
16831684 xmlNsPtr nsptr ;
16841685
16851686 if (ref != NULL ) {
@@ -1691,7 +1692,6 @@ static int schema_element(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr element, sdlTyp
16911692 cur_type -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (cptype ));
16921693 }
16931694 if (str_ns ) {efree (str_ns );}
1694- if (cptype ) {efree (cptype );}
16951695 }
16961696
16971697 trav = element -> children ;
@@ -1766,7 +1766,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
17661766 memset (newAttr , 0 , sizeof (sdlAttribute ));
17671767
17681768 if (ref ) {
1769- char * attr_name , * ns ;
1769+ const char * attr_name ;
1770+ char * ns ;
17701771 xmlNsPtr nsptr ;
17711772
17721773 parse_namespace (ref -> children -> content , & attr_name , & ns );
@@ -1787,7 +1788,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
17871788 smart_str_appends (& key , attr_name );
17881789 smart_str_0 (& key );
17891790 newAttr -> ref = estrndup (ZSTR_VAL (key .s ), ZSTR_LEN (key .s ));
1790- if (attr_name ) {efree (attr_name );}
17911791 if (ns ) {efree (ns );}
17921792 } else {
17931793 xmlAttrPtr ns ;
@@ -1827,7 +1827,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
18271827 /* type = QName */
18281828 type = get_attribute (attrType -> properties , "type" );
18291829 if (type ) {
1830- char * cptype , * str_ns ;
1830+ const char * cptype ;
1831+ char * str_ns ;
18311832 xmlNsPtr nsptr ;
18321833
18331834 if (ref != NULL ) {
@@ -1839,7 +1840,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
18391840 newAttr -> encode = get_create_encoder (sdl , cur_type , nsptr -> href , BAD_CAST (cptype ));
18401841 }
18411842 if (str_ns ) {efree (str_ns );}
1842- if (cptype ) {efree (cptype );}
18431843 }
18441844
18451845 attr = attrType -> properties ;
@@ -1881,7 +1881,8 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
18811881 smart_str key2 = {0 };
18821882 sdlExtraAttributePtr ext ;
18831883 xmlNsPtr nsptr ;
1884- char * value , * ns ;
1884+ const char * value ;
1885+ char * ns ;
18851886
18861887 ext = emalloc (sizeof (sdlExtraAttribute ));
18871888 memset (ext , 0 , sizeof (sdlExtraAttribute ));
@@ -1894,7 +1895,6 @@ static int schema_attribute(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrType, sdl
18941895 ext -> val = estrdup ((char * )attr -> children -> content );
18951896 }
18961897 if (ns ) {efree (ns );}
1897- efree (value );
18981898
18991899 if (!newAttr -> extraAttributes ) {
19001900 newAttr -> extraAttributes = emalloc (sizeof (HashTable ));
@@ -2007,7 +2007,8 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou
20072007 smart_str_free (& key );
20082008 } else if (ref ) {
20092009 sdlAttributePtr newAttr ;
2010- char * group_name , * ns ;
2010+ const char * group_name ;
2011+ char * ns ;
20112012 smart_str key = {0 };
20122013 xmlNsPtr nsptr ;
20132014
@@ -2027,7 +2028,6 @@ static int schema_attributeGroup(sdlPtr sdl, xmlAttrPtr tns, xmlNodePtr attrGrou
20272028 smart_str_appends (& key , group_name );
20282029 smart_str_0 (& key );
20292030 newAttr -> ref = estrndup (ZSTR_VAL (key .s ), ZSTR_LEN (key .s ));
2030- if (group_name ) {efree (group_name );}
20312031 if (ns ) {efree (ns );}
20322032 smart_str_free (& key );
20332033
0 commit comments