Skip to content

Commit c51f0df

Browse files
committed
review
1 parent e144fc6 commit c51f0df

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

ext/soap/php_packet_soap.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
177177
fault = get_node_ex(body->children,"Fault",envelope_ns);
178178
if (fault != NULL) {
179179
char *faultcode = NULL;
180-
zend_string *lang = NULL;
180+
zend_string *lang = ZSTR_EMPTY_ALLOC();
181181
zend_string *faultstring = NULL, *faultactor = NULL;
182182
zval details;
183183
xmlNodePtr tmp;
@@ -248,9 +248,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
248248
if (faultactor) {
249249
zend_string_release_ex(faultactor, 0);
250250
}
251-
if (lang) {
252-
zend_string_release_ex(lang, false);
253-
}
251+
zend_string_release_ex(lang, false);
254252
if (Z_REFCOUNTED(details)) {
255253
Z_DELREF(details);
256254
}

ext/soap/soap.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ PHP_METHOD(SoapFault, __construct)
668668
char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *fault_code_ns = NULL;
669669
size_t fault_string_len, fault_actor_len = 0, fault_code_len = 0;
670670
zend_string *name = NULL;
671-
zend_string *lang = NULL;
671+
zend_string *lang = ZSTR_EMPTY_ALLOC();
672672
zval *details = NULL, *headerfault = NULL, *this_ptr;
673673
zend_string *code_str;
674674
HashTable *code_ht;
@@ -681,7 +681,7 @@ PHP_METHOD(SoapFault, __construct)
681681
Z_PARAM_ZVAL_OR_NULL(details)
682682
Z_PARAM_STR_OR_NULL(name)
683683
Z_PARAM_ZVAL_OR_NULL(headerfault)
684-
Z_PARAM_PATH_STR_OR_NULL(lang)
684+
Z_PARAM_PATH_STR(lang)
685685
ZEND_PARSE_PARAMETERS_END();
686686

687687
if (code_str) {
@@ -1730,7 +1730,7 @@ PHP_METHOD(SoapServer, fault)
17301730
soapServicePtr service;
17311731
xmlCharEncodingHandlerPtr old_encoding;
17321732

1733-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szSS",
1733+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szSP",
17341734
&code, &code_len, &string, &string_len, &actor, &actor_len, &details,
17351735
&name, &lang) == FAILURE) {
17361736
RETURN_THROWS();
@@ -2999,9 +2999,7 @@ static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fau
29992999
if (name != NULL) {
30003000
ZVAL_STR_COPY(Z_FAULT_NAME_P(obj), name);
30013001
}
3002-
if (lang != NULL) {
3003-
ZVAL_STR_COPY(Z_FAULT_LANG_P(obj), lang);
3004-
}
3002+
ZVAL_STR_COPY(Z_FAULT_LANG_P(obj), lang);
30053003
}
30063004
/* }}} */
30073005

0 commit comments

Comments
 (0)