Skip to content

Commit dc90390

Browse files
committed
Avoid pointless refcounting in php_intl_idn_to_46()
1 parent f39c07a commit dc90390

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/intl/idn/idn.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,20 +90,20 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS,
9090
ZSTR_VAL(buffer)[len] = '\0';
9191
ZSTR_LEN(buffer) = len;
9292

93-
if (info.errors == 0) {
94-
RETVAL_STR_COPY(buffer);
95-
} else {
96-
RETVAL_FALSE;
97-
}
98-
9993
if (idna_info) {
10094
add_assoc_str_ex(idna_info, "result", sizeof("result")-1, zend_string_copy(buffer));
10195
add_assoc_bool_ex(idna_info, "isTransitionalDifferent",
10296
sizeof("isTransitionalDifferent")-1, info.isTransitionalDifferent);
10397
add_assoc_long_ex(idna_info, "errors", sizeof("errors")-1, (zend_long)info.errors);
10498
}
10599

106-
zend_string_release(buffer);
100+
if (info.errors == 0) {
101+
RETVAL_STR(buffer);
102+
} else {
103+
zend_string_release_ex(buffer, false);
104+
RETVAL_FALSE;
105+
}
106+
107107
uidna_close(uts46);
108108
}
109109

0 commit comments

Comments
 (0)