File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -499,14 +499,14 @@ PHP_METHOD(DOMXPath, quote) {
499
499
memcpy (ZSTR_VAL (output ) + 1 , input , input_len );
500
500
ZSTR_VAL (output )[input_len + 1 ] = '\'' ;
501
501
ZSTR_VAL (output )[input_len + 2 ] = '\0' ;
502
- RETURN_STR (output );
502
+ RETURN_NEW_STR (output );
503
503
} else if (memchr (input , '"' , input_len ) == NULL ) {
504
504
zend_string * const output = zend_string_safe_alloc (1 , input_len , 2 , false);
505
505
ZSTR_VAL (output )[0 ] = '"' ;
506
506
memcpy (ZSTR_VAL (output ) + 1 , input , input_len );
507
507
ZSTR_VAL (output )[input_len + 1 ] = '"' ;
508
508
ZSTR_VAL (output )[input_len + 2 ] = '\0' ;
509
- RETURN_STR (output );
509
+ RETURN_NEW_STR (output );
510
510
} else {
511
511
smart_str output = {0 };
512
512
// need to use the concat() trick published by Robert Rossney at https://stackoverflow.com/a/1352556/1067003
@@ -528,7 +528,7 @@ PHP_METHOD(DOMXPath, quote) {
528
528
}
529
529
ZEND_ASSERT (ptr == end );
530
530
ZSTR_VAL (output .s )[ZSTR_LEN (output .s ) - 1 ] = ')' ;
531
- RETURN_STR (smart_str_extract (& output ));
531
+ RETURN_NEW_STR (smart_str_extract (& output ));
532
532
}
533
533
}
534
534
/* }}} */
You can’t perform that action at this time.
0 commit comments