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 ++++-------- src/sp_disabled_functions.h | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'src') 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; } diff --git a/src/sp_disabled_functions.h b/src/sp_disabled_functions.h index 9629308..f80c9c2 100644 --- a/src/sp_disabled_functions.h +++ b/src/sp_disabled_functions.h @@ -5,6 +5,5 @@ int hook_disabled_functions(); bool should_disable(zend_execute_data *, const char *, const char *, const char *); bool should_drop_on_ret(zval *, const zend_execute_data *const); -char* get_complete_function_path(zend_execute_data const* const execute_data); #endif /* __SP_DISABLE_FUNCTIONS_H */ -- cgit v1.3