From b55b87dc022319ed5049736c7aa8d862d00d7c69 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 12 Jan 2018 18:22:45 +0100 Subject: Minor factorization and symbol exposure reduction --- src/sp_disabled_functions.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/sp_disabled_functions.c') diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index 6e1b95a..24d4749 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c @@ -83,7 +83,7 @@ static bool is_local_var_matching( } else { char* var_value_str = sp_convert_to_string(var_value); bool match = sp_match_value(var_value_str, config_node->value, - config_node->value_r); + config_node->value_r); efree(var_value_str); if (true == match) { @@ -236,7 +236,7 @@ bool should_disable(zend_execute_data* execute_data, const char* builtin_name, if (!complete_path_function) { if (builtin_name) { - complete_path_function = (char*)builtin_name; + complete_path_function = estrdup(builtin_name); } else { return false; } @@ -329,18 +329,14 @@ bool should_disable(zend_execute_data* execute_data, const char* builtin_name, if (true == config_node->simulation) { goto next; } else { // We've got a match, the function won't be executed - if (builtin_name == NULL) { - efree(complete_path_function); - } + efree(complete_path_function); return true; } next: config = config->next; } allow: - if (builtin_name == NULL) { - efree(complete_path_function); - } + efree(complete_path_function); return false; } -- cgit v1.3