File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,17 @@ PHP_METHOD(SoapHeader, __construct)
520
520
}
521
521
/* }}} */
522
522
523
+ static void soap_fault_dtor_properties (zval * obj )
524
+ {
525
+ zval_ptr_dtor (Z_FAULT_STRING_P (obj ));
526
+ zval_ptr_dtor (Z_FAULT_CODE_P (obj ));
527
+ zval_ptr_dtor (Z_FAULT_CODENS_P (obj ));
528
+ zval_ptr_dtor (Z_FAULT_ACTOR_P (obj ));
529
+ zval_ptr_dtor (Z_FAULT_DETAIL_P (obj ));
530
+ zval_ptr_dtor (Z_FAULT_NAME_P (obj ));
531
+ zval_ptr_dtor (Z_FAULT_HEADERFAULT_P (obj ));
532
+ }
533
+
523
534
/* {{{ SoapFault constructor */
524
535
PHP_METHOD (SoapFault , __construct )
525
536
{
@@ -539,6 +550,9 @@ PHP_METHOD(SoapFault, __construct)
539
550
Z_PARAM_ZVAL_OR_NULL (headerfault )
540
551
ZEND_PARSE_PARAMETERS_END ();
541
552
553
+ /* Delete previously set properties */
554
+ soap_fault_dtor_properties (ZEND_THIS );
555
+
542
556
if (code_str ) {
543
557
fault_code = ZSTR_VAL (code_str );
544
558
fault_code_len = ZSTR_LEN (code_str );
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ GH-14586: SoapFault::__construct() leaks memory if called twice
3
+ --EXTENSIONS--
4
+ soap
5
+ --FILE--
6
+ <?php
7
+ $ sf = new SoapFault (null , "x " );
8
+ $ sf ->__construct (null , "x " );
9
+ ?>
10
+ DONE
11
+ --EXPECT--
12
+ DONE
You can’t perform that action at this time.
0 commit comments