Skip to content

Commit 306a519

Browse files
authored
Avoid allocating memory in soap get_function() (php#15843)
1 parent 81d580e commit 306a519

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

ext/soap/soap.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4176,18 +4176,13 @@ static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name, size_t
41764176
{
41774177
sdlFunctionPtr tmp;
41784178

4179-
char *str = estrndup(function_name, function_name_length);
4180-
zend_str_tolower(str, function_name_length);
41814179
if (sdl != NULL) {
4182-
if ((tmp = zend_hash_str_find_ptr(&sdl->functions, str, function_name_length)) != NULL) {
4183-
efree(str);
4180+
if ((tmp = zend_hash_str_find_ptr_lc(&sdl->functions, function_name, function_name_length)) != NULL) {
41844181
return tmp;
4185-
} else if (sdl->requests != NULL && (tmp = zend_hash_str_find_ptr(sdl->requests, str, function_name_length)) != NULL) {
4186-
efree(str);
4182+
} else if (sdl->requests != NULL && (tmp = zend_hash_str_find_ptr_lc(sdl->requests, function_name, function_name_length)) != NULL) {
41874183
return tmp;
41884184
}
41894185
}
4190-
efree(str);
41914186
return NULL;
41924187
}
41934188
/* }}} */

0 commit comments

Comments
 (0)