diff options
| author | Ben Foster | 2017-10-25 23:53:07 +0100 |
|---|---|---|
| committer | Ben Foster | 2017-10-26 21:14:00 +0100 |
| commit | 1eb51a18ec06b3c8add77d876af0f5a599279c67 (patch) | |
| tree | abd9a74672c5111edf6ee6aea0f9c0dd843ca580 /src/snuffleupagus.c | |
| parent | 59b3db273e6e628afb188681e178ea53d571b03d (diff) | |
Free additionally allocated `sp_list` instances
References #43.
Diffstat (limited to 'src/snuffleupagus.c')
| -rw-r--r-- | src/snuffleupagus.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/snuffleupagus.c b/src/snuffleupagus.c index 2cc31d8..7db6c93 100644 --- a/src/snuffleupagus.c +++ b/src/snuffleupagus.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #endif | 3 | #endif |
| 4 | 4 | ||
| 5 | #include "php_snuffleupagus.h" | 5 | #include "php_snuffleupagus.h" |
| 6 | #include "sp_config.h" | ||
| 6 | 7 | ||
| 7 | #ifndef ZEND_EXT_API | 8 | #ifndef ZEND_EXT_API |
| 8 | #define ZEND_EXT_API ZEND_DLEXPORT | 9 | #define ZEND_EXT_API ZEND_DLEXPORT |
| @@ -118,11 +119,20 @@ PHP_MSHUTDOWN_FUNCTION(snuffleupagus) { | |||
| 118 | pefree(SNUFFLEUPAGUS_G(config.config_upload_validation), 1); | 119 | pefree(SNUFFLEUPAGUS_G(config.config_upload_validation), 1); |
| 119 | pefree(SNUFFLEUPAGUS_G(config.config_cookie_encryption), 1); | 120 | pefree(SNUFFLEUPAGUS_G(config.config_cookie_encryption), 1); |
| 120 | 121 | ||
| 121 | sp_list_free(SNUFFLEUPAGUS_G(config.config_disabled_functions->disabled_functions)); | 122 | sp_node_t* disabled_functions = SNUFFLEUPAGUS_G(config.config_disabled_functions->disabled_functions); |
| 123 | sp_node_t* disabled_functions_ret = SNUFFLEUPAGUS_G(config.config_disabled_functions_ret->disabled_functions); | ||
| 124 | sp_node_t* disabled_constructs = SNUFFLEUPAGUS_G(config.config_disabled_constructs->construct_include); | ||
| 125 | |||
| 126 | // Free the list of disabled functions for each `sp_disabled_function` instance | ||
| 127 | sp_disabled_function_list_free(disabled_functions); | ||
| 128 | sp_disabled_function_list_free(disabled_functions_ret); | ||
| 129 | sp_disabled_function_list_free(disabled_constructs); | ||
| 130 | |||
| 131 | sp_list_free(disabled_functions); | ||
| 122 | pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions), 1); | 132 | pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions), 1); |
| 123 | sp_list_free(SNUFFLEUPAGUS_G(config.config_disabled_functions_ret->disabled_functions)); | 133 | sp_list_free(disabled_functions_ret); |
| 124 | pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions_ret), 1); | 134 | pefree(SNUFFLEUPAGUS_G(config.config_disabled_functions_ret), 1); |
| 125 | sp_list_free(SNUFFLEUPAGUS_G(config.config_disabled_constructs->construct_include)); | 135 | sp_list_free(disabled_constructs); |
| 126 | pefree(SNUFFLEUPAGUS_G(config.config_disabled_constructs), 1); | 136 | pefree(SNUFFLEUPAGUS_G(config.config_disabled_constructs), 1); |
| 127 | 137 | ||
| 128 | UNREGISTER_INI_ENTRIES(); | 138 | UNREGISTER_INI_ENTRIES(); |
