Skip to content

Commit c4c1261

Browse files
committed
soap: Fix const violation
1 parent ae0bf44 commit c4c1261

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ext/soap/php_encoding.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,23 +2529,25 @@ static zval *to_zval_array(zval *ret, encodeTypePtr type, xmlNodePtr data)
25292529
if (data &&
25302530
(attr = get_attribute(data->properties,"arrayType")) &&
25312531
attr->children && attr->children->content) {
2532-
char *type, *end, *ns;
2532+
const char *type;
2533+
char *end, *ns;
25332534
xmlNsPtr nsptr;
25342535

25352536
parse_namespace(attr->children->content, &type, &ns);
2537+
char *type_dup = estrdup(type);
25362538
nsptr = xmlSearchNs(attr->doc, attr->parent, BAD_CAST(ns));
25372539

2538-
end = strrchr(type,'[');
2540+
end = strrchr(type_dup,'[');
25392541
if (end) {
25402542
*end = '\0';
25412543
dimension = calc_dimension(end+1);
25422544
dims = get_position(dimension, end+1);
25432545
}
25442546
if (nsptr != NULL) {
2545-
enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type);
2547+
enc = get_encoder(SOAP_GLOBAL(sdl), (char*)nsptr->href, type_dup);
25462548
}
25472549
if (ns) {efree(ns);}
2548-
2550+
if (type_dup) efree(type_dup);
25492551
} else if ((attr = get_attribute(data->properties,"itemType")) &&
25502552
attr->children &&
25512553
attr->children->content) {

0 commit comments

Comments
 (0)